From nobody Thu Oct 2 13:01:40 2025 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE15321CC59 for ; Tue, 16 Sep 2025 12:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758026528; cv=none; b=V+pNtlMMM8FWBu2clWFhpiW1OeFjsq3wU1C70Fe7jUhn0ZU3wroJDU28UeFV+FT4Tak/Jcl3H8+fHvAAb5kww+UQnhxBETFXQ9lXRds2hCCs4dMVCeaIeegJDO47LqJCNhXffVx6Jwpoy8aWKPA3DaZ9DVJRkVd6Rywa5n+qwxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758026528; c=relaxed/simple; bh=xV6c4xU+fLhW9GO5Uf+hdtT9Gy4K5wxlXEfxI6H2CKo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UWvr7IQnEUMplkM7Ejif6S7GSB0DAMnhMHv9mKu+SAmKF51doDjz7qx1P/O7tYVjRWPVl6oOFQlsa4n5ySGaG3Y3u3h1ThcZUl63p3zVjMSeIxHczvpn/8fvzH9xu0P7SCh8T7me2pliFyxM7xdblkFtxGOutSMzYVhEsAgHUt0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=p1BHP+kF; arc=none smtp.client-ip=95.215.58.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="p1BHP+kF" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1758026511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=bPCT1+TcCxAxBd09Xa6o7zuOImvO2FpODExXiYxCmOw=; b=p1BHP+kFWiRNGPEZuCadMZQDTJ9B6l+VcKizdydVaak8Mo7dRFDvV1i4/H88/8aljzECUV hhZ/FaeGwBe3lqoApCLVQGDkCMODzWeV+ud1mZ8F8Lc56UtcgEUfUcWMnXwLlF755EwaBq X/Cb1cywqKnWDOyZ2uv2yILieL0bjZs= From: Thorsten Blum To: Dmitry Osipenko , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Thierry Reding , Jonathan Hunter Cc: Thorsten Blum , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / devfreq: tegra30: use min to simplify actmon_cpu_to_emc_rate Date: Tue, 16 Sep 2025 14:40:58 +0200 Message-ID: <20250916124059.2489125-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Use min() to improve the readability of actmon_cpu_to_emc_rate() and remove any unnecessary curly braces. No functional changes intended. Signed-off-by: Thorsten Blum --- drivers/devfreq/tegra30-devfreq.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-de= vfreq.c index 890990e03335..a4041b9d0052 100644 --- a/drivers/devfreq/tegra30-devfreq.c +++ b/drivers/devfreq/tegra30-devfreq.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -326,14 +327,9 @@ static unsigned long actmon_cpu_to_emc_rate(struct teg= ra_devfreq *tegra, unsigned int i; const struct tegra_actmon_emc_ratio *ratio =3D actmon_emc_ratios; =20 - for (i =3D 0; i < ARRAY_SIZE(actmon_emc_ratios); i++, ratio++) { - if (cpu_freq >=3D ratio->cpu_freq) { - if (ratio->emc_freq >=3D tegra->max_freq) - return tegra->max_freq; - else - return ratio->emc_freq; - } - } + for (i =3D 0; i < ARRAY_SIZE(actmon_emc_ratios); i++, ratio++) + if (cpu_freq >=3D ratio->cpu_freq) + return min(ratio->emc_freq, tegra->max_freq); =20 return 0; } --=20 2.51.0