mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Simplify maximum determination in si_calc_upll_dividers()
@ 2025-02-28 15:45 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2025-02-28 15:45 UTC (permalink / raw)
  To: amd-gfx, dri-devel, Alex Deucher, Boyuan Zhang,
	Christian König, David Airlie, Ma Jun, Simona Vetter,
	Sunil Khatri
  Cc: LKML, kernel-janitors, Qasim Ijaz

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 28 Feb 2025 16:37:00 +0100

Replace nested max() calls by single max3() call in this
function implementation.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/gpu/drm/amd/amdgpu/si.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index 026e8376e2c0..2a255fb15768 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -1726,7 +1726,7 @@ static int si_calc_upll_dividers(struct amdgpu_device *adev,
 	unsigned optimal_score = ~0;

 	/* Loop through vco from low to high */
-	vco_min = max(max(vco_min, vclk), dclk);
+	vco_min = max3(vco_min, vclk, dclk);
 	for (vco_freq = vco_min; vco_freq <= vco_max; vco_freq += 100) {
 		uint64_t fb_div = (uint64_t)vco_freq * fb_factor;
 		unsigned vclk_div, dclk_div, score;
--
2.48.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-28 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-28 15:45 [PATCH] drm/amdgpu: Simplify maximum determination in si_calc_upll_dividers() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®