* [PATCH] drm/amd/display: reduce else-if to else in dcn10_blank_pixel_data()
@ 2023-01-27 1:38 Tom Rix
2023-01-31 17:20 ` Alex Deucher
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-01-27 1:38 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
christian.koenig, Xinhui.Pan, airlied, daniel, Anthony.Koo,
alex.hung, aurabindo.pillai, Roman.Li, wenjing.liu, Dillon.Varone,
mwen, dingchen.zhang, martin.tsai, aric.cyr, Wesley.Chalmers,
Max.Tseng, sivapiriyan.kumarasamy, Tony.Cheng
Cc: Tom Rix, dri-devel, amd-gfx, linux-kernel
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")
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index bb155734ac93..f735ae5e045f 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amd/display: reduce else-if to else in dcn10_blank_pixel_data()
2023-01-27 1:38 [PATCH] drm/amd/display: reduce else-if to else in dcn10_blank_pixel_data() Tom Rix
@ 2023-01-31 17:20 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2023-01-31 17:20 UTC (permalink / raw)
To: Tom Rix
Cc: aric.cyr, wenjing.liu, dri-devel, linux-kernel, airlied,
Anthony.Koo, Rodrigo.Siqueira, amd-gfx, alex.hung,
aurabindo.pillai, harry.wentland, sivapiriyan.kumarasamy,
martin.tsai, sunpeng.li, mwen, Tony.Cheng, Dillon.Varone,
dingchen.zhang, Wesley.Chalmers, Xinhui.Pan, Roman.Li, Max.Tseng,
daniel, alexander.deucher, christian.koenig
Applied. Thanks!
On Thu, Jan 26, 2023 at 8:38 PM Tom Rix <trix@redhat.com> wrote:
>
> 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")
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> index bb155734ac93..f735ae5e045f 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> @@ -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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-31 17:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-27 1:38 [PATCH] drm/amd/display: reduce else-if to else in dcn10_blank_pixel_data() Tom Rix
2023-01-31 17:20 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox