public inbox for linux-fbdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings
@ 2023-06-22 16:46 Gustavo A. R. Silva
  2023-06-22 17:38 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2023-06-22 16:46 UTC (permalink / raw)
  To: Helge Deller
  Cc: linux-fbdev, dri-devel, linux-kernel, Gustavo A. R. Silva,
	linux-hardening

Fix the following fallthrough warnings seen after building sh
architecture with sh7763rdp_defconfig configuration:

drivers/video/fbdev/sh7760fb.c: In function 'sh7760fb_get_color_info':
drivers/video/fbdev/sh7760fb.c:138:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
  138 |                 lgray = 1;
      |                 ~~~~~~^~~
drivers/video/fbdev/sh7760fb.c:139:9: note: here
  139 |         case LDDFR_4BPP:
      |         ^~~~
drivers/video/fbdev/sh7760fb.c:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
  143 |                 lgray = 1;
      |                 ~~~~~~^~~
drivers/video/fbdev/sh7760fb.c:144:9: note: here
  144 |         case LDDFR_8BPP:
      |         ^~~~

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/video/fbdev/sh7760fb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c
index 768011bdb430..98c5227098a8 100644
--- a/drivers/video/fbdev/sh7760fb.c
+++ b/drivers/video/fbdev/sh7760fb.c
@@ -136,11 +136,13 @@ static int sh7760fb_get_color_info(struct device *dev,
 		break;
 	case LDDFR_4BPP_MONO:
 		lgray = 1;
+		fallthrough;
 	case LDDFR_4BPP:
 		lbpp = 4;
 		break;
 	case LDDFR_6BPP_MONO:
 		lgray = 1;
+		fallthrough;
 	case LDDFR_8BPP:
 		lbpp = 8;
 		break;
-- 
2.34.1


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

* Re: [PATCH][next] fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings
  2023-06-22 16:46 [PATCH][next] fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings Gustavo A. R. Silva
@ 2023-06-22 17:38 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2023-06-22 17:38 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: linux-fbdev, dri-devel, linux-kernel, linux-hardening

On 6/22/23 18:46, Gustavo A. R. Silva wrote:
> Fix the following fallthrough warnings seen after building sh
> architecture with sh7763rdp_defconfig configuration:
>
> drivers/video/fbdev/sh7760fb.c: In function 'sh7760fb_get_color_info':
> drivers/video/fbdev/sh7760fb.c:138:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    138 |                 lgray = 1;
>        |                 ~~~~~~^~~
> drivers/video/fbdev/sh7760fb.c:139:9: note: here
>    139 |         case LDDFR_4BPP:
>        |         ^~~~
> drivers/video/fbdev/sh7760fb.c:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    143 |                 lgray = 1;
>        |                 ~~~~~~^~~
> drivers/video/fbdev/sh7760fb.c:144:9: note: here
>    144 |         case LDDFR_8BPP:
>        |         ^~~~
>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

applied.

Thanks!
Helge

> ---
>   drivers/video/fbdev/sh7760fb.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c
> index 768011bdb430..98c5227098a8 100644
> --- a/drivers/video/fbdev/sh7760fb.c
> +++ b/drivers/video/fbdev/sh7760fb.c
> @@ -136,11 +136,13 @@ static int sh7760fb_get_color_info(struct device *dev,
>   		break;
>   	case LDDFR_4BPP_MONO:
>   		lgray = 1;
> +		fallthrough;
>   	case LDDFR_4BPP:
>   		lbpp = 4;
>   		break;
>   	case LDDFR_6BPP_MONO:
>   		lgray = 1;
> +		fallthrough;
>   	case LDDFR_8BPP:
>   		lbpp = 8;
>   		break;


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

end of thread, other threads:[~2023-06-22 17:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-22 16:46 [PATCH][next] fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings Gustavo A. R. Silva
2023-06-22 17:38 ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox