[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210711092147.17689-1-len.baker@gmx.com>
Date: Sun, 11 Jul 2021 11:21:47 +0200
From: Len Baker <len.baker@....com>
To: Harry Wentland <harry.wentland@....com>,
Leo Li <sunpeng.li@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>
Cc: Len Baker <len.baker@....com>, Anthony Koo <Anthony.Koo@....com>,
Eryk Brol <eryk.brol@....com>,
"AMD\ramini" <Reza.Amini@....com>,
Qingqing Zhuo <qingqing.zhuo@....com>,
Aric Cyr <aric.cyr@....com>, Felipe <Felipe.Clark@....com>,
"Max.Tseng" <Max.Tseng@....com>, Alvin Lee <alvin.lee2@....com>,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drm/amd/display: Fix identical code for different branches
The ternary expression:
vrr->state == VRR_STATE_ACTIVE_VARIABLE ? max_refresh : max_refresh;
has identical then and else expressions. So, simplify the code.
Addresses-Coverity-ID: 1471122 ("Identical code for different branches")
Fixes: 9bc4162665827 ("drm/amd/display: Implement VSIF V3 extended refresh rate feature")
Signed-off-by: Len Baker <len.baker@....com>
---
drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 3f4f44b44e6a..54374c7d309b 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -613,9 +613,8 @@ static void build_vrr_infopacket_data_v3(const struct mod_vrr_params *vrr,
(vrr->state == VRR_STATE_INACTIVE) ? min_refresh :
max_refresh; // Non-fs case, program nominal range
- max_programmed = (vrr->state == VRR_STATE_ACTIVE_FIXED) ? fixed_refresh :
- (vrr->state == VRR_STATE_ACTIVE_VARIABLE) ? max_refresh :
- max_refresh;// Non-fs case, program nominal range
+ max_programmed = (vrr->state == VRR_STATE_ACTIVE_FIXED) ?
+ fixed_refresh : max_refresh;
/* PB7 = FreeSync Minimum refresh rate (Hz) */
infopacket->sb[7] = min_programmed & 0xFF;
--
2.25.1
Powered by blists - more mailing lists