Skip to contentSkip to conversation

drm/amd/display: remove an unnecessary NULL check

PATCH Applied Dan Carpenter 2 participants 2 messages Jul 14, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: remove an unnecessary NULL check

The "stream" pointer can't be NULL and it's dereferenced on the line before so the check doesn't make sense.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -1
index 4f97329d9daf..7e58f242dab9 100644
@@ -2324,7 +2324,7 @@ static void commit_planes_for_stream(struct dc *dc,
 
 	if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed)
 		if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
-			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 };
 
Signature · 1 line
2.27.0
Applied
#1 lore raw
Quoted 5 lines · Dan Carpenter

The "stream" pointer can't be NULL and it's dereferenced on the line before so the check doesn't make sense.

Applied. Thanks!

Alex

Quoted 24 lines
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -2
index 4f97329d9daf..7e58f242dab9 100644
@@ -2324,7 +2324,7 @@ static void commit_planes_for_stream(struct dc *dc,
 
        if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed)
                if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
-                       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.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx