From: coverity-bot <keescook@chromium.org>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Leo Li" <sunpeng.li@amd.com>, "Roman Li" <roman.li@amd.com>,
"Fangzhi Zuo" <Jerry.Zuo@amd.com>,
"hersen wu" <hersenxs.wu@amd.com>,
dri-devel@lists.freedesktop.org,
"Christian König" <christian.koenig@amd.com>,
"Lijo Lazar" <lijo.lazar@amd.com>,
"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
"Harry Wentland" <harry.wentland@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"David Airlie" <airlied@gmail.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"Daniel Wheeler" <daniel.wheeler@amd.com>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
linux-next@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Coverity: dm_dmub_sw_init(): Incorrect expression
Date: Thu, 12 Jan 2023 14:25:21 -0800 [thread overview]
Message-ID: <202301121425.FB249B61B4@keescook> (raw)
Hello!
This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20230111 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan
You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:
Tue Jan 10 14:32:57 2023 -0500
a7ab345149b8 ("drm/amd/display: Load DMUB microcode during early_init")
Coverity reported the following:
*** CID 1530544: Incorrect expression (IDENTICAL_BRANCHES)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951 in dm_dmub_sw_init()
1945
1946 switch (adev->ip_versions[DCE_HWIP][0]) {
1947 case IP_VERSION(2, 1, 0):
1948 dmub_asic = DMUB_ASIC_DCN21;
1949 break;
1950 case IP_VERSION(3, 0, 0):
vvv CID 1530544: Incorrect expression (IDENTICAL_BRANCHES)
vvv The same code is executed regardless of whether "adev->ip_versions[GC_HWIP][0] == 656128U" is true, because the 'then' and 'else' branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced?
1951 if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
1952 dmub_asic = DMUB_ASIC_DCN30;
1953 else
1954 dmub_asic = DMUB_ASIC_DCN30;
1955 break;
1956 case IP_VERSION(3, 0, 1):
If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1530544 ("Incorrect expression")
Fixes: a7ab345149b8 ("drm/amd/display: Load DMUB microcode during early_init")
Thanks for your attention!
--
Coverity-bot
next reply other threads:[~2023-01-12 22:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 22:25 coverity-bot [this message]
2023-01-12 22:39 ` Coverity: dm_dmub_sw_init(): Incorrect expression Limonciello, Mario
2023-01-12 22:45 ` Kees Cook
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=202301121425.FB249B61B4@keescook \
--to=keescook@chromium.org \
--cc=Jerry.Zuo@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo@embeddedor.com \
--cc=harry.wentland@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=roman.li@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