Skip to contentSkip to conversation

video: offb: annotate implicit fall throughs

PATCH In review Mathieu Malaterre 3 participants 3 messages Jan 14, 2019 – Feb 8, 2019 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: offb: annotate implicit fall throughs

There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings (W=1). Fix them up.

This commit remove the following warnings:

drivers/video/fbdev/offb.c:211:5: warning: this statement may fall through [-Wimplicit-fallthrough=] drivers/video/fbdev/offb.c:142:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 drivers/video/fbdev/offb.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/video/fbdev/offb.c +2 -0
index 31f769d67195..e0f0c5351306 100644
@@ -141,6 +141,7 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 		/* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */
 		out_le32(par->cmap_adr + 0x58,
 			 in_le32(par->cmap_adr + 0x58) & ~0x20);
+		/* fall through */
 	case cmap_r128:
 		/* Set palette index & data */
 		out_8(par->cmap_adr + 0xb0, regno);
@@ -210,6 +211,7 @@ static int offb_blank(int blank, struct fb_info *info)
 				/* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */
 				out_le32(par->cmap_adr + 0x58,
 					 in_le32(par->cmap_adr + 0x58) & ~0x20);
+				/* fall through */
 			case cmap_r128:
 				/* Set palette index & data */
 				out_8(par->cmap_adr + 0xb0, i);
Signature · 1 line
2.19.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Mathieu Malaterre

There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings (W=1). Fix them up.

This commit remove the following warnings:

drivers/video/fbdev/offb.c:211:5: warning: this statement may fall through [-Wimplicit-fallthrough=] drivers/video/fbdev/offb.c:142:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Thanks
--
Gustavo

Quoted 25 lines
---
  drivers/video/fbdev/offb.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/video/fbdev/offb.c +2 -0
index 31f769d67195..e0f0c5351306 100644
@@ -141,6 +141,7 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
  		/* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */
  		out_le32(par->cmap_adr + 0x58,
  			 in_le32(par->cmap_adr + 0x58) & ~0x20);
+		/* fall through */
  	case cmap_r128:
  		/* Set palette index & data */
  		out_8(par->cmap_adr + 0xb0, regno);
@@ -210,6 +211,7 @@ static int offb_blank(int blank, struct fb_info *info)
  				/* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */
  				out_le32(par->cmap_adr + 0x58,
  					 in_le32(par->cmap_adr + 0x58) & ~0x20);
+				/* fall through */
  			case cmap_r128:
  				/* Set palette index & data */
  				out_8(par->cmap_adr + 0xb0, i);
#2 lore raw
Quoted 6 lines · Gustavo A. R. Silva
Quoted 3 lines · Mathieu Malaterre

There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings (W=1). Fix them up.

Quoted 8 lines
Quoted 6 lines

This commit remove the following warnings:

drivers/video/fbdev/offb.c:211:5: warning: this statement may fall through [-Wimplicit-fallthrough=] drivers/video/fbdev/offb.c:142:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Patch queued for v5.1, thanks.

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