Skip to contentSkip to conversation

video: fbdev: Mark expected switch fall-through

PATCH In review Anders Roxell 2 participants 2 messages Jul 30, 2019 – Aug 19, 2019 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 video: fbdev: Mark expected switch fall-through

Now that -Wimplicit-fallthrough is passed to GCC by default, the following warnings shows up:

../drivers/video/fbdev/sh_mobile_lcdcfb.c: In function ‘sh_mobile_lcdc_channel_fb_init’:
../drivers/video/fbdev/sh_mobile_lcdcfb.c:2086:22: warning: this statement may fall
through [-Wimplicit-fallthrough=]
info->fix.ypanstep = 2;
~~~~~~~~~~~~~~~~~~~^~~
../drivers/video/fbdev/sh_mobile_lcdcfb.c:2087:2: note: here
case V4L2_PIX_FMT_NV16:
^~~~
../drivers/video/fbdev/sh_mobile_lcdcfb.c: In function ‘sh_mobile_lcdc_overlay_fb_init’:
../drivers/video/fbdev/sh_mobile_lcdcfb.c:1596:22: warning: this statement may fall
through [-Wimplicit-fallthrough=]
info->fix.ypanstep = 2;
~~~~~~~~~~~~~~~~~~~^~~
../drivers/video/fbdev/sh_mobile_lcdcfb.c:1597:2: note: here
case V4L2_PIX_FMT_NV16:
^~~~

Rework to address a warnings due to the enablement of -Wimplicit-fallthrough.

---
 drivers/video/fbdev/sh_mobile_lcdcfb.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/video/fbdev/sh_mobile_lcdcfb.c +2 -0
index ac0bcac9a865..c249763dbf0b 100644
@@ -1594,6 +1594,7 @@ sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl)
 	case V4L2_PIX_FMT_NV12:
 	case V4L2_PIX_FMT_NV21:
 		info->fix.ypanstep = 2;
+		/* Fall through */
 	case V4L2_PIX_FMT_NV16:
 	case V4L2_PIX_FMT_NV61:
 		info->fix.xpanstep = 2;
@@ -2084,6 +2085,7 @@ sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
 	case V4L2_PIX_FMT_NV12:
 	case V4L2_PIX_FMT_NV21:
 		info->fix.ypanstep = 2;
+		/* Fall through */
 	case V4L2_PIX_FMT_NV16:
 	case V4L2_PIX_FMT_NV61:
 		info->fix.xpanstep = 2;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 16 lines · Anders Roxell

Now that -Wimplicit-fallthrough is passed to GCC by default, the following warnings shows up:

../drivers/video/fbdev/sh_mobile_lcdcfb.c: In function ‘sh_mobile_lcdc_channel_fb_init’:
../drivers/video/fbdev/sh_mobile_lcdcfb.c:2086:22: warning: this statement may fall
through [-Wimplicit-fallthrough=]

   info->fix.ypanstep = 2;
   ~~~~~~~~~~~~~~~~~~~^~~

../drivers/video/fbdev/sh_mobile_lcdcfb.c:2087:2: note: here
case V4L2_PIX_FMT_NV16:
^~~~
../drivers/video/fbdev/sh_mobile_lcdcfb.c: In function ‘sh_mobile_lcdc_overlay_fb_init’:
../drivers/video/fbdev/sh_mobile_lcdcfb.c:1596:22: warning: this statement may fall
through [-Wimplicit-fallthrough=]

   info->fix.ypanstep = 2;
   ~~~~~~~~~~~~~~~~~~~^~~
Quoted 8 lines

../drivers/video/fbdev/sh_mobile_lcdcfb.c:1597:2: note: here
case V4L2_PIX_FMT_NV16:
^~~~

Rework to address a warnings due to the enablement of -Wimplicit-fallthrough.

Patch queued for v5.4, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics