From: Joe Perches <joe@perches.com>
To: "Len Baker" <len.baker@gmx.com>,
"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>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>
Cc: Wenjing Liu <wenjing.liu@amd.com>,
Martin Tsai <martin.tsai@amd.com>,
Kees Cook <keescook@chromium.org>,
George Shen <George.Shen@amd.com>,
Yu-ting Shen <Yu-ting.Shen@amd.com>,
Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display: Fix identical code for different branches
Date: Sun, 11 Jul 2021 10:45:48 -0700 [thread overview]
Message-ID: <a8f75357ab3bd3b37269e51a38aafa997307570f.camel@perches.com> (raw)
In-Reply-To: <20210711172433.2777-1-len.baker@gmx.com>
On Sun, 2021-07-11 at 19:24 +0200, Len Baker wrote:
> The branches of the "if" statement are the same. So remove the
> unnecessary if and goto statements.
>
> Addresses-Coverity-ID: 1456916 ("Identical code for different branches")
> Fixes: 4c283fdac08ab ("drm/amd/display: Add HDCP module")
> Signed-off-by: Len Baker <len.baker@gmx.com>
I'm not a big fan of this type of change.
It's currently the same style used for six tests in this function
and changing this last one would just make it harder to see the
code blocks as consistent.
I doubt any reasonable compiler would produce different objects.
> diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c
[]
> @@ -305,10 +305,8 @@ static enum mod_hdcp_status wait_for_ready(struct mod_hdcp *hdcp,
> hdcp, "bcaps_read"))
> goto out;
> }
> - if (!mod_hdcp_execute_and_set(check_ksv_ready,
> - &input->ready_check, &status,
> - hdcp, "ready_check"))
> - goto out;
> + mod_hdcp_execute_and_set(check_ksv_ready, &input->ready_check, &status,
> + hdcp, "ready_check");
> out:
> return status;
> }
> --
> 2.25.1
>
next prev parent reply other threads:[~2021-07-11 17:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-11 17:24 Len Baker
2021-07-11 17:45 ` Joe Perches [this message]
2021-07-16 17:10 ` Len Baker
-- strict thread matches above, loose matches on Subject: below --
2021-07-11 9:21 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=a8f75357ab3bd3b37269e51a38aafa997307570f.camel@perches.com \
--to=joe@perches.com \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=George.Shen@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=Yu-ting.Shen@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=keescook@chromium.org \
--cc=len.baker@gmx.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.tsai@amd.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=sunpeng.li@amd.com \
--cc=wenjing.liu@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®