LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH linux-next] drm:dcn31: fix boolreturn.cocci warnings
@ 2021-08-24  5:52 CGEL
  2021-08-26 20:25 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: CGEL @ 2021-08-24  5:52 UTC (permalink / raw)
  To: Harry Wentland
  Cc: Leo Li, Alex Deucher, David Airlie, Nicholas Kazlauskas,
	Huang Rui, amd-gfx, dri-devel, linux-kernel, Jing Yangyang,
	Zeal Robot

From: Jing Yangyang <jing.yangyang@zte.com.cn>

./drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c:112:9-10:WARNING:
return of 0/1 in function 'dcn31_is_panel_backlight_on'
with return type bool

./drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c:122:9-10:WARNING:
return of 0/1 in function 'dcn31_is_panel_powered_on'
with return type bool

Return statements in functions returning bool should use true/false
instead of 1/0.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
---
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
index 7db268d..3b37213 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
@@ -109,7 +109,7 @@ bool dcn31_is_panel_backlight_on(struct panel_cntl *panel_cntl)
 	union dmub_rb_cmd cmd;
 
 	if (!dcn31_query_backlight_info(panel_cntl, &cmd))
-		return 0;
+		return false;
 
 	return cmd.panel_cntl.data.is_backlight_on;
 }
@@ -119,7 +119,7 @@ bool dcn31_is_panel_powered_on(struct panel_cntl *panel_cntl)
 	union dmub_rb_cmd cmd;
 
 	if (!dcn31_query_backlight_info(panel_cntl, &cmd))
-		return 0;
+		return false;
 
 	return cmd.panel_cntl.data.is_powered_on;
 }
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH linux-next] drm:dcn31: fix boolreturn.cocci warnings
  2021-08-24  5:52 [PATCH linux-next] drm:dcn31: fix boolreturn.cocci warnings CGEL
@ 2021-08-26 20:25 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2021-08-26 20:25 UTC (permalink / raw)
  To: CGEL
  Cc: Harry Wentland, Leo Li, Alex Deucher, David Airlie,
	Nicholas Kazlauskas, Huang Rui, amd-gfx list,
	Maling list - DRI developers, LKML, Jing Yangyang, Zeal Robot

Applied.  Thanks!

Alex

On Tue, Aug 24, 2021 at 1:52 AM CGEL <cgel.zte@gmail.com> wrote:
>
> From: Jing Yangyang <jing.yangyang@zte.com.cn>
>
> ./drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c:112:9-10:WARNING:
> return of 0/1 in function 'dcn31_is_panel_backlight_on'
> with return type bool
>
> ./drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c:122:9-10:WARNING:
> return of 0/1 in function 'dcn31_is_panel_powered_on'
> with return type bool
>
> Return statements in functions returning bool should use true/false
> instead of 1/0.
>
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
> ---
>  drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
> index 7db268d..3b37213 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
> @@ -109,7 +109,7 @@ bool dcn31_is_panel_backlight_on(struct panel_cntl *panel_cntl)
>         union dmub_rb_cmd cmd;
>
>         if (!dcn31_query_backlight_info(panel_cntl, &cmd))
> -               return 0;
> +               return false;
>
>         return cmd.panel_cntl.data.is_backlight_on;
>  }
> @@ -119,7 +119,7 @@ bool dcn31_is_panel_powered_on(struct panel_cntl *panel_cntl)
>         union dmub_rb_cmd cmd;
>
>         if (!dcn31_query_backlight_info(panel_cntl, &cmd))
> -               return 0;
> +               return false;
>
>         return cmd.panel_cntl.data.is_powered_on;
>  }
> --
> 1.8.3.1
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-26 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24  5:52 [PATCH linux-next] drm:dcn31: fix boolreturn.cocci warnings CGEL
2021-08-26 20:25 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).