[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230619105514.1888-1-lidong@vivo.com>
Date: Mon, 19 Jun 2023 18:54:45 +0800
From: Li Dong <lidong@...o.com>
To: Harry Wentland <harry.wentland@....com>,
Leo Li <sunpeng.li@....com>,
Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, Aric Cyr <aric.cyr@....com>,
Tom Rix <trix@...hat.com>,
Qingqing Zhuo <qingqing.zhuo@....com>,
Anthony Koo <Anthony.Koo@....com>,
"Leo (Hanghong) Ma" <hanghong.ma@....com>,
Li Dong <lidong@...o.com>,
Dillon Varone <Dillon.Varone@....com>,
Austin Zheng <austin.zheng@....com>,
Mike Hsieh <Mike.Hsieh@....com>,
amd-gfx@...ts.freedesktop.org (open list:AMD DISPLAY CORE),
dri-devel@...ts.freedesktop.org (open list:DRM DRIVERS),
linux-kernel@...r.kernel.org (open list)
Cc: opensource.kernel@...o.com
Subject: [PATCH] gpu: drm/amd: Fix traditional comparison using max method
It would be better to replace the traditional ternary conditional operator with max()
Signed-off-by: Li Dong <lidong@...o.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
Powered by blists - more mailing lists