* [PATCH] drm/radeon: Simplify maximum determination in radeon_uvd_calc_upll_dividers()
@ 2025-02-28 16:36 Markus Elfring
2025-02-28 17:49 ` Natalie Vock
0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2025-02-28 16:36 UTC (permalink / raw)
To: amd-gfx, dri-devel, Alex Deucher, Christian König,
David Airlie, Simona Vetter
Cc: LKML, kernel-janitors, Qasim Ijaz
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 28 Feb 2025 17:32:45 +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/radeon/radeon_uvd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
index 058a1c8451b2..ded5747a58d1 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -961,7 +961,7 @@ int radeon_uvd_calc_upll_dividers(struct radeon_device *rdev,
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;
--
2.48.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/radeon: Simplify maximum determination in radeon_uvd_calc_upll_dividers()
2025-02-28 16:36 [PATCH] drm/radeon: Simplify maximum determination in radeon_uvd_calc_upll_dividers() Markus Elfring
@ 2025-02-28 17:49 ` Natalie Vock
0 siblings, 0 replies; 2+ messages in thread
From: Natalie Vock @ 2025-02-28 17:49 UTC (permalink / raw)
To: Markus Elfring, amd-gfx, dri-devel, Alex Deucher,
Christian König, David Airlie, Simona Vetter
Cc: LKML, kernel-janitors, Qasim Ijaz
On 28.02.25 17:36, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 28 Feb 2025 17:32:45 +0100
>
> Replace nested max() calls by single max3() call in this
> function implementation.
>
> This issue was transformed by using the Coccinelle software.
How about something like "this change was made" or "this code was
transformed"? Coccinelle didn't transform the issue, it transformed the
code to solve the issue.
Cheers,
Natalie
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/radeon/radeon_uvd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
> index 058a1c8451b2..ded5747a58d1 100644
> --- a/drivers/gpu/drm/radeon/radeon_uvd.c
> +++ b/drivers/gpu/drm/radeon/radeon_uvd.c
> @@ -961,7 +961,7 @@ int radeon_uvd_calc_upll_dividers(struct radeon_device *rdev,
> 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;
> --
> 2.48.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-28 17:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-28 16:36 [PATCH] drm/radeon: Simplify maximum determination in radeon_uvd_calc_upll_dividers() Markus Elfring
2025-02-28 17:49 ` Natalie Vock
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®