From: Len Baker <len.baker@gmx.com>
To: "Harry Wentland" <harry.wentland@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>
Cc: Len Baker <len.baker@gmx.com>, Anthony Koo <Anthony.Koo@amd.com>,
Eryk Brol <eryk.brol@amd.com>, "AMD\ramini" <Reza.Amini@amd.com>,
Qingqing Zhuo <qingqing.zhuo@amd.com>,
Aric Cyr <aric.cyr@amd.com>, Felipe <Felipe.Clark@amd.com>,
"Max.Tseng" <Max.Tseng@amd.com>, Alvin Lee <alvin.lee2@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drm/amd/display: Fix identical code for different branches
Date: Sun, 11 Jul 2021 11:21:47 +0200 [thread overview]
Message-ID: <20210711092147.17689-1-len.baker@gmx.com> (raw)
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@gmx.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
next reply other threads:[~2021-07-11 9:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-11 9:21 Len Baker [this message]
2021-07-11 17:24 Len Baker
2021-07-11 17:45 ` Joe Perches
2021-07-16 17:10 ` Len Baker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210711092147.17689-1-len.baker@gmx.com \
--to=len.baker@gmx.com \
--cc=Anthony.Koo@amd.com \
--cc=Felipe.Clark@amd.com \
--cc=Max.Tseng@amd.com \
--cc=Reza.Amini@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=alvin.lee2@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aric.cyr@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=eryk.brol@amd.com \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qingqing.zhuo@amd.com \
--cc=sunpeng.li@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®