lkml.org 
[lkml]   [2023]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] gpu: drm/amd: Fix traditional comparison using max method
Date
It would be better to replace the traditional ternary conditional operator with max()

Signed-off-by: Li Dong <lidong@vivo.com>
---
drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index dbd60811f95d..a5eabde53fa4 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -1005,8 +1005,7 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
(stream->timing.h_total * stream->ctx->dc->caps.max_v_total));
}
/* Limit minimum refresh rate to what can be supported by hardware */
- min_refresh_in_uhz = min_hardware_refresh_in_uhz > in_config->min_refresh_in_uhz ?
- min_hardware_refresh_in_uhz : in_config->min_refresh_in_uhz;
+ min_refresh_in_uhz = max(min_hardware_refresh_in_uhz, in_config->min_refresh_in_uhz);
max_refresh_in_uhz = in_config->max_refresh_in_uhz;

/* Full range may be larger than current video timing, so cap at nominal */
--
2.31.1.windows.1
\
 
 \ /
  Last update: 2023-06-19 13:03    [W:0.038 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site