Skip to contentSkip to conversation

drm/amd/display: remove useless check in should_enable_fbc()

PATCH Applied Dembskiy Igor 3 participants 3 messages Aug 30, 2023 – Aug 31, 2023

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

PATCH 1/1 drm/amd/display: remove useless check in should_enable_fbc()

It does not make sense to compare a pointer to array element with NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 65d38262b3e8 ("drm/amd/display: fbc state could not reach while enable fbc")
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -3
index 6966420dfbac..e87cf54ec658 100644
@@ -1992,9 +1992,6 @@ static bool should_enable_fbc(struct dc *dc,
 
 			pipe_ctx = &res_ctx->pipe_ctx[i];
 
-			if (!pipe_ctx)
-				continue;
-
 			/* fbc not applicable on underlay pipe */
 			if (pipe_ctx->pipe_idx != underlay_idx) {
 				*pipe_idx = i;
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dembskiy Igor

It does not make sense to compare a pointer to array element with NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 65d38262b3e8 ("drm/amd/display: fbc state could not reach while enable fbc")

Harry

Quoted 18 lines
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -3
index 6966420dfbac..e87cf54ec658 100644
@@ -1992,9 +1992,6 @@ static bool should_enable_fbc(struct dc *dc,
 
 			pipe_ctx = &res_ctx->pipe_ctx[i];
 
-			if (!pipe_ctx)
-				continue;
-
 			/* fbc not applicable on underlay pipe */
 			if (pipe_ctx->pipe_idx != underlay_idx) {
 				*pipe_idx = i;
Applied
#2 lore raw

Applied. Thanks!

Alex

Quoted 32 lines · Harry Wentland
Quoted 6 lines · Dembskiy Igor

It does not make sense to compare a pointer to array element with NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 65d38262b3e8 ("drm/amd/display: fbc state could not reach while enable fbc")

Harry

Quoted 18 lines
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -3
index 6966420dfbac..e87cf54ec658 100644
@@ -1992,9 +1992,6 @@ static bool should_enable_fbc(struct dc *dc,
 
                      pipe_ctx = &res_ctx->pipe_ctx[i];
 
-                     if (!pipe_ctx)
-                             continue;
-
                      /* fbc not applicable on underlay pipe */
                      if (pipe_ctx->pipe_idx != underlay_idx) {
                              *pipe_idx = i;