From: Dan Carpenter <dan.carpenter@oracle.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "Joshua Aberback" <joshua.aberback@amd.com>,
kernel-janitors@vger.kernel.org, "Alex Hung" <alex.hung@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Wenjing Liu" <wenjing.liu@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
amd-gfx@lists.freedesktop.org,
"Nicholas Kazlauskas" <nicholas.kazlauskas@amd.com>,
"Meenakshikumar Somasundaram"
<meenakshikumar.somasundaram@amd.com>,
"David Airlie" <airlied@linux.ie>, "Roy Chan" <roy.chan@amd.com>,
"Michael Strauss" <michael.strauss@amd.com>,
"Alvin Lee" <Alvin.Lee2@amd.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Martin Leung" <martin.leung@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Jun Lei" <Jun.Lei@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Jimmy Kizito" <Jimmy.Kizito@amd.com>
Subject: [PATCH] drm/amd/display: Remove unnecessary NULL check in commit_planes_for_stream()
Date: Wed, 13 Jul 2022 14:33:37 +0300 [thread overview]
Message-ID: <Ys6tkVXQeJcgeZn0@kili> (raw)
Smatch complains that:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3369 commit_planes_for_stream()
warn: variable dereferenced before check 'stream' (see line 3114)
The 'stream' pointer cannot be NULL and the check can be removed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index dc2c59995a19..76f9af2c5e19 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3366,7 +3366,7 @@ static void commit_planes_for_stream(struct dc *dc,
top_pipe_to_program->stream_res.tg,
CRTC_STATE_VACTIVE);
- if (stream && should_use_dmub_lock(stream->link)) {
+ if (should_use_dmub_lock(stream->link)) {
union dmub_hw_lock_flags hw_locks = { 0 };
struct dmub_hw_lock_inst_flags inst_flags = { 0 };
--
2.35.1
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "Leo Li" <sunpeng.li@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@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>,
"Nicholas Kazlauskas" <nicholas.kazlauskas@amd.com>,
"Jun Lei" <Jun.Lei@amd.com>,
"Meenakshikumar Somasundaram"
<meenakshikumar.somasundaram@amd.com>,
"Martin Leung" <martin.leung@amd.com>,
"Michael Strauss" <michael.strauss@amd.com>,
"Jimmy Kizito" <Jimmy.Kizito@amd.com>,
"Alvin Lee" <Alvin.Lee2@amd.com>, "Alex Hung" <alex.hung@amd.com>,
"Wenjing Liu" <wenjing.liu@amd.com>,
"Joshua Aberback" <joshua.aberback@amd.com>,
"Roy Chan" <roy.chan@amd.com>,
amd-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] drm/amd/display: Remove unnecessary NULL check in commit_planes_for_stream()
Date: Wed, 13 Jul 2022 14:33:37 +0300 [thread overview]
Message-ID: <Ys6tkVXQeJcgeZn0@kili> (raw)
Smatch complains that:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3369 commit_planes_for_stream()
warn: variable dereferenced before check 'stream' (see line 3114)
The 'stream' pointer cannot be NULL and the check can be removed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index dc2c59995a19..76f9af2c5e19 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3366,7 +3366,7 @@ static void commit_planes_for_stream(struct dc *dc,
top_pipe_to_program->stream_res.tg,
CRTC_STATE_VACTIVE);
- if (stream && should_use_dmub_lock(stream->link)) {
+ if (should_use_dmub_lock(stream->link)) {
union dmub_hw_lock_flags hw_locks = { 0 };
struct dmub_hw_lock_inst_flags inst_flags = { 0 };
--
2.35.1
next reply other threads:[~2022-07-13 11:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 11:33 Dan Carpenter [this message]
2022-07-13 11:33 ` [PATCH] drm/amd/display: Remove unnecessary NULL check in commit_planes_for_stream() Dan Carpenter
2022-07-14 16:37 ` Alex Deucher
2022-07-14 16:37 ` Alex Deucher
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=Ys6tkVXQeJcgeZn0@kili \
--to=dan.carpenter@oracle.com \
--cc=Alvin.Lee2@amd.com \
--cc=Jimmy.Kizito@amd.com \
--cc=Jun.Lei@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=harry.wentland@amd.com \
--cc=joshua.aberback@amd.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=martin.leung@amd.com \
--cc=meenakshikumar.somasundaram@amd.com \
--cc=michael.strauss@amd.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=roy.chan@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.