Skip to contentSkip to conversation

fbdev: sh7760fb: document fallthrough cases

PATCH In review Randy Dunlap 3 participants 4 messages Nov 15, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: sh7760fb: document fallthrough cases

Fix fallthrough warnings in sh776fb.c:

../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:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
143 | lgray = 1;

Just document the current state of code execution/flow.

Fixes 4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver")
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
Cc Manuel Lauss <[email protected]>
Cc Yoshinori Sato <[email protected]>
Cc Rich Felker <[email protected]>
---
 drivers/video/fbdev/sh7760fb.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/video/fbdev/sh7760fb.c +2 -0
@@ -136,11 +136,13 @@ static int sh7760fb_get_color_info(struc
 		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;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Randy Dunlap

Fix fallthrough warnings in sh776fb.c:

../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:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
143 | lgray = 1;

Just document the current state of code execution/flow.

Quoted 10 lines
Fixes 4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver")
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
Cc Manuel Lauss <[email protected]>
Cc Yoshinori Sato <[email protected]>
Cc Rich Felker <[email protected]>

Thanks, Randy.
--
Gustavo

Quoted 20 lines
---
 drivers/video/fbdev/sh7760fb.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/video/fbdev/sh7760fb.c +2 -0
@@ -136,11 +136,13 @@ static int sh7760fb_get_color_info(struc
 		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;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Randy Dunlap
Quoted 8 lines · Randy Dunlap

Fix fallthrough warnings in sh776fb.c:

../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:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
143 | lgray = 1;

Quoted 4 lines

Just document the current state of code execution/flow.

Fixes 4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver")

Section 30.4.4 ("Data Format") of the SH7760 Group Hardware Manual confirms fall-through is appropriate here (especially for the odd 6 bpp mode).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw
Quoted 11 lines · Geert Uytterhoeven
Quoted 10 lines · Randy Dunlap

Fix fallthrough warnings in sh776fb.c:

../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:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
143 | lgray = 1;

Just document the current state of code execution/flow.

Quoted 8 lines
Quoted 2 lines
Fixes 4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver")

Section 30.4.4 ("Data Format") of the SH7760 Group Hardware Manual confirms fall-through is appropriate here (especially for the odd 6 bpp mode).

I'm taking this in my -next tree[1].

Thanks
--
Gustavo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp-misc-fixes