Skip to contentSkip to conversation

fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Jun 22, 2023 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings

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:
      |         ^~~~
---
 drivers/video/fbdev/sh7760fb.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/video/fbdev/sh7760fb.c +2 -0
index 768011bdb430..98c5227098a8 100644
@@ -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;
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 17 lines · Gustavo A. R. Silva

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:
       |         ^~~~
Quoted 1 line

applied.

Thanks!
Helge

Quoted 22 lines
---
  drivers/video/fbdev/sh7760fb.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/video/fbdev/sh7760fb.c +2 -0
index 768011bdb430..98c5227098a8 100644
@@ -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;