Skip to contentSkip to conversation

drm/amd/display: reduce else-if to else in dcn10_blank_pixel_data()

PATCH Applied Tom Rix 2 participants 2 messages Jan 27, 2023 – Jan 31, 2023

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 drm/amd/display: reduce else-if to else in dcn10_blank_pixel_data()

checkpatch reports
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c:2902:13: style:
Expression is always true because 'else if' condition is opposite to previous condition at line 2895. [multiCondition]

 } else if (blank) {
            ^
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c:2895:6: note: first condition
 if (!blank) {
     ^

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c:2902:13: note: else if condition is opposite to first condition
} else if (blank) {

It is not necessary to explicitly the check != condition, an else is simplier.

Fixes aa5a57773042 ("drm/amd/display: Vari-bright looks disabled near end of MM14")
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
index bb155734ac93..f735ae5e045f 100644
@@ -2899,7 +2899,7 @@ void dcn10_blank_pixel_data(
 			dc->hwss.set_pipe(pipe_ctx);
 			stream_res->abm->funcs->set_abm_level(stream_res->abm, stream->abm_level);
 		}
-	} else if (blank) {
+	} else {
 		dc->hwss.set_abm_immediate_disable(pipe_ctx);
 		if (stream_res->tg->funcs->set_blank) {
 			stream_res->tg->funcs->wait_for_state(stream_res->tg, CRTC_STATE_VBLANK);
Signature · 1 line
2.26.3
Applied
#1 lore raw

Applied. Thanks!

Quoted 36 lines · Tom Rix

checkpatch reports
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c:2902:13: style:
Expression is always true because 'else if' condition is opposite to previous condition at line 2895. [multiCondition]

 } else if (blank) {
            ^
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c:2895:6: note: first condition
 if (!blank) {
     ^

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c:2902:13: note: else if condition is opposite to first condition
} else if (blank) {

It is not necessary to explicitly the check != condition, an else is simplier.

Fixes aa5a57773042 ("drm/amd/display: Vari-bright looks disabled near end of MM14")
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -2
index bb155734ac93..f735ae5e045f 100644
@@ -2899,7 +2899,7 @@ void dcn10_blank_pixel_data(
                        dc->hwss.set_pipe(pipe_ctx);
                        stream_res->abm->funcs->set_abm_level(stream_res->abm, stream->abm_level);
                }
-       } else if (blank) {
+       } else {
                dc->hwss.set_abm_immediate_disable(pipe_ctx);
                if (stream_res->tg->funcs->set_blank) {
                        stream_res->tg->funcs->wait_for_state(stream_res->tg, CRTC_STATE_VBLANK);
--

2.26.3