diff mbox series

drm/amdgpu: Simplify maximum determination in si_calc_upll_dividers()

Message ID 9574279b-6e02-467c-8e0f-28a037e061d9@web.de (mailing list archive)
State New
Headers show
Series drm/amdgpu: Simplify maximum determination in si_calc_upll_dividers() | expand

Commit Message

Markus Elfring Feb. 28, 2025, 3:45 p.m. UTC
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(-)

--
2.48.1
diff mbox series

Patch

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;