fbdev: Use fallthrough pseudo-keyword
Subsystems (11)
PATCH 1/1 fbdev: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case.
--- drivers/video/fbdev/acornfb.c | 2 +- drivers/video/fbdev/arcfb.c | 2 +- drivers/video/fbdev/atmel_lcdfb.c | 4 ++-- drivers/video/fbdev/aty/radeon_pm.c | 6 +++--- drivers/video/fbdev/cirrusfb.c | 4 ++-- drivers/video/fbdev/controlfb.c | 2 +- drivers/video/fbdev/core/fbmem.c | 2 +- drivers/video/fbdev/fsl-diu-fb.c | 4 ++-- drivers/video/fbdev/gxt4500.c | 2 +- drivers/video/fbdev/i740fb.c | 2 +- drivers/video/fbdev/offb.c | 4 ++-- drivers/video/fbdev/omap/lcdc.c | 4 ++-- drivers/video/fbdev/omap/omapfb_main.c | 20 +++++++++---------- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 4 ++-- .../video/fbdev/omap2/omapfb/omapfb-ioctl.c | 2 +- .../video/fbdev/omap2/omapfb/omapfb-main.c | 2 +- drivers/video/fbdev/pm2fb.c | 4 ++-- drivers/video/fbdev/pxafb.c | 2 +- drivers/video/fbdev/s3c-fb.c | 6 +++--- drivers/video/fbdev/sa1100fb.c | 2 +- drivers/video/fbdev/savage/savagefb_driver.c | 3 +-- drivers/video/fbdev/sh_mobile_lcdcfb.c | 4 ++-- drivers/video/fbdev/sm501fb.c | 2 +- drivers/video/fbdev/tdfxfb.c | 2 +- drivers/video/fbdev/xen-fbfront.c | 2 +- 25 files changed, 46 insertions(+), 47 deletions(-)
drivers/video/fbdev/acornfb.c +1 -1
@@ -857,7 +857,7 @@ static void acornfb_parse_dram(char *opt)case 'M' :case 'm' : size *=1024 ; -/* Fall through */ + fallthrough;case 'K' :case 'k' : size *=1024 ;
drivers/video/fbdev/arcfb.c +1 -1
@@ -419,7 +419,7 @@ static int arcfb_ioctl(struct fb_info *info,schedule ();finish_wait (&arcfb_waitq, &wait); } -/* fall through */ + fallthrough;case FBIO_GETCONTROL2 : {
drivers/video/fbdev/atmel_lcdfb.c +2 -2
@@ -508,7 +508,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,case 32 : var->transp.offset =24 ; var->transp.length =8 ; -/* fall through */ + fallthrough;case 24 :if (pdata->lcd_wiring_mode ==ATMEL_LCDC_WIRING_RGB ) {/* RGB:888 mode */
@@ -633,7 +633,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)case 2 : value |=ATMEL_LCDC_PIXELSIZE_2 ;break ;case 4 : value |=ATMEL_LCDC_PIXELSIZE_4 ;break ;case 8 : value |=ATMEL_LCDC_PIXELSIZE_8 ;break ; -case 15 :/* fall through */ +case 15 : fallthrough;case 16 : value |=ATMEL_LCDC_PIXELSIZE_16 ;break ;case 24 : value |=ATMEL_LCDC_PIXELSIZE_24 ;break ;case 32 : value |=ATMEL_LCDC_PIXELSIZE_32 ;break ;
drivers/video/fbdev/aty/radeon_pm.c +3 -3
@@ -1208,11 +1208,11 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)case 1 :if (mc &0x4 )break ; -/* fall through */ + fallthrough;case 2 : dll_sleep_mask |=MDLL_R300_RDCK__MRDCKB_SLEEP ; dll_reset_mask |=MDLL_R300_RDCK__MRDCKB_RESET ; -/* fall through */ + fallthrough;case 0 : dll_sleep_mask |=MDLL_R300_RDCK__MRDCKA_SLEEP ; dll_reset_mask |=MDLL_R300_RDCK__MRDCKA_RESET ;
@@ -1221,7 +1221,7 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)case 1 :if (!(mc &0x4 ))break ; -/* fall through */ + fallthrough;case 2 : dll_sleep_mask |=MDLL_R300_RDCK__MRDCKD_SLEEP ; dll_reset_mask |=MDLL_R300_RDCK__MRDCKD_RESET ;
drivers/video/fbdev/cirrusfb.c +2 -2
@@ -1476,11 +1476,11 @@ static void init_vgachip(struct fb_info *info)mdelay (100 );/* mode */ vga_wgfx (cinfo->regbase,CL_GR31 ,0x00 ); -/* fall through */ + fallthrough;case BT_GD5480 :/* from Klaus' NetBSD driver: */ vga_wgfx (cinfo->regbase,CL_GR2F ,0x00 ); -/* fall through */ + fallthrough;case BT_ALPINE :/* put blitter into 542x compat */ vga_wgfx (cinfo->regbase,CL_GR33 ,0x00 );
drivers/video/fbdev/controlfb.c +1 -1
@@ -713,7 +713,7 @@ static int controlfb_blank(int blank_mode, struct fb_info *info)break ;case FB_BLANK_POWERDOWN : ctrl &= ~0x33 ; -/* fall through */ + fallthrough;case FB_BLANK_NORMAL : ctrl |=0x400 ;break ;
drivers/video/fbdev/core/fbmem.c +1 -1
@@ -1310,7 +1310,7 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd,case FBIOGET_CON2FBMAP :case FBIOPUT_CON2FBMAP : arg = (unsigned long )compat_ptr (arg); -/* fall through */ + fallthrough;case FBIOBLANK : ret =do_fb_ioctl (info, cmd, arg);break ;
drivers/video/fbdev/fsl-diu-fb.c +2 -2
@@ -1287,7 +1287,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,dev_warn (info->dev,"MFB_SET_PIXFMT value of 0x%08x is deprecated.\n" ,MFB_SET_PIXFMT_OLD ); -/* fall through */ + fallthrough;case MFB_SET_PIXFMT :if (copy_from_user (&pix_fmt, buf,sizeof (pix_fmt)))return -EFAULT ;
@@ -1297,7 +1297,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,dev_warn (info->dev,"MFB_GET_PIXFMT value of 0x%08x is deprecated.\n" ,MFB_GET_PIXFMT_OLD ); -/* fall through */ + fallthrough;case MFB_GET_PIXFMT : pix_fmt = ad->pix_fmt;if (copy_to_user (buf, &pix_fmt,sizeof (pix_fmt)))
drivers/video/fbdev/gxt4500.c +1 -1
@@ -534,7 +534,7 @@ static int gxt4500_setcolreg(unsigned int reg, unsigned int red,break ;case DFA_PIX_32BIT : val |= (reg <<24 ); -/* fall through */ + fallthrough;case DFA_PIX_24BIT : val |= (reg <<16 ) | (reg <<8 );break ;
drivers/video/fbdev/i740fb.c +1 -1
@@ -430,7 +430,7 @@ static int i740fb_decode_var(const struct fb_var_screeninfo *var,break ; case 9 ... 15: bpp =15 ; -/* fall through */ + fallthrough;case 16 :if ((1000000 / var->pixclock) >DACSPEED16 ) { dev_err(info->device, "requested pixclock %i MHz out of range (max. %i MHz at 15/16bpp)\n",
drivers/video/fbdev/offb.c +2 -2
@@ -141,7 +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 */ + fallthrough;case cmap_r128:/* Set palette index & data */ out_8 (par->cmap_adr +0xb0 , regno);
@@ -211,7 +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 */ + fallthrough;case cmap_r128:/* Set palette index & data */ out_8 (par->cmap_adr +0xb0 , i);
drivers/video/fbdev/omap/lcdc.c +2 -2
@@ -328,13 +328,13 @@ static int omap_lcdc_setup_plane(int plane, int channel_out, lcdc.bpp =12 ;break ; } -/* fallthrough */ + fallthrough;case OMAPFB_COLOR_YUV422 :if (lcdc.ext_mode) { lcdc.bpp =16 ;break ; } -/* fallthrough */ + fallthrough;default :/* FIXME: other BPPs. * bpp1: code 0, size 256
drivers/video/fbdev/omap/omapfb_main.c +10 -10
@@ -253,7 +253,7 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green,if (fbdev->ctrl->setcolreg) r = fbdev->ctrl->setcolreg (regno, red, green, blue, transp, update_hw_pal); -/* Fallthrough */ + fallthrough;case OMAPFB_COLOR_RGB565 :case OMAPFB_COLOR_RGB444 :if (r !=0 )
@@ -443,7 +443,7 @@ static int set_color_mode(struct omapfb_plane_struct *plane,return 0 ;case 12 : var->bits_per_pixel =16 ; -/* fall through */ + fallthrough;case 16 :if (plane->fbdev->panel->bpp ==12 ) plane->color_mode =OMAPFB_COLOR_RGB444 ;
@@ -1531,27 +1531,27 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)case OMAPFB_ACTIVE :for (i =0 ; i < fbdev->mem_desc.region_cnt; i++)unregister_framebuffer (fbdev->fb_info[i]); -/* fall through */ + fallthrough;case 7 :omapfb_unregister_sysfs (fbdev); -/* fall through */ + fallthrough;case 6 :if (fbdev->panel->disable) fbdev->panel->disable (fbdev->panel); -/* fall through */ + fallthrough;case 5 :omapfb_set_update_mode (fbdev,OMAPFB_UPDATE_DISABLED ); -/* fall through */ + fallthrough;case 4 :planes_cleanup (fbdev); -/* fall through */ + fallthrough;case 3 :ctrl_cleanup (fbdev); -/* fall through */ + fallthrough;case 2 :if (fbdev->panel->cleanup) fbdev->panel->cleanup (fbdev->panel); -/* fall through */ + fallthrough;case 1 :dev_set_drvdata (fbdev->dev,NULL );kfree (fbdev);
@@ -1854,7 +1854,7 @@ static int __init omapfb_setup(char *options)case 'm' :case 'M' : vram *=1024 ; -/* Fall through */ + fallthrough;case 'k' :case 'K' : vram *=1024 ;
drivers/video/fbdev/omap2/omapfb/dss/dispc.c +2 -2
@@ -1858,7 +1858,7 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,if (color_mode ==OMAP_DSS_COLOR_YUV2 || color_mode ==OMAP_DSS_COLOR_UYVY ) width = width >>1 ; -/* fall through */ + fallthrough;case OMAP_DSS_ROT_90 :case OMAP_DSS_ROT_270 : *offset1 =0 ;
@@ -1881,7 +1881,7 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,if (color_mode ==OMAP_DSS_COLOR_YUV2 || color_mode ==OMAP_DSS_COLOR_UYVY ) width = width >>1 ; -/* fall through */ + fallthrough;case OMAP_DSS_ROT_90 +4 :case OMAP_DSS_ROT_270 +4 : *offset1 =0 ;
drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +1 -1
@@ -760,7 +760,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) r = -ENODEV ;break ; } -/* FALLTHROUGH */ + fallthrough;case OMAPFB_WAITFORVSYNC :DBG ("ioctl WAITFORVSYNC\n" );
drivers/video/fbdev/omap2/omapfb/omapfb-main.c +1 -1
@@ -882,7 +882,7 @@ int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl, / (var->bits_per_pixel >> 2);break ; } -/* fall through */ + fallthrough;default : screen_width = fix->line_length / (var->bits_per_pixel >>3 );break ;
drivers/video/fbdev/pm2fb.c +2 -2
@@ -233,10 +233,10 @@ static u32 to3264(u32 timing, int bpp, int is64)switch (bpp) {case 24 : timing *=3 ; -/* fall through */ + fallthrough;case 8 : timing >>=1 ; -/* fall through */ + fallthrough;case 16 : timing >>=1 ;case 32 :
drivers/video/fbdev/pxafb.c +1 -1
@@ -1614,7 +1614,7 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state)*/ if (old_state !=C_DISABLE_PM )break ; -/* fall through */ + fallthrough;case C_ENABLE :/*
drivers/video/fbdev/s3c-fb.c +3 -3
@@ -284,7 +284,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,/* 666 with one bit alpha/transparency */ var->transp.offset =18 ; var->transp.length =1 ; -/* fall through */ + fallthrough;case 18 : var->bits_per_pixel =32 ;
@@ -312,7 +312,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,case 25 : var->transp.length = var->bits_per_pixel -24 ; var->transp.offset =24 ; -/* fall through */ + fallthrough;case 24 :/* our 24bpp is unpacked, so 32bpp */ var->bits_per_pixel =32 ;
@@ -809,7 +809,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)case FB_BLANK_POWERDOWN : wincon &= ~WINCONx_ENWIN; sfb->enabled &= ~(1 << index); -/* fall through - to FB_BLANK_NORMAL */ + fallthrough;/* to FB_BLANK_NORMAL */ case FB_BLANK_NORMAL :/* disable the DMA and display 0x0 (black) */
drivers/video/fbdev/sa1100fb.c +1 -1
@@ -935,7 +935,7 @@ static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state)*/ if (old_state !=C_DISABLE_PM )break ; -/* fall through */ + fallthrough;case C_ENABLE :/*
drivers/video/fbdev/savage/savagefb_driver.c +1 -2
@@ -1859,8 +1859,7 @@ static int savage_init_hw(struct savagefb_par *par)vga_out8 (0x3d4 ,0x68 , par);/* memory control 1 */ if ((vga_in8 (0x3d5 , par) &0xC0 ) == (0x01 <<6 )) RamSavage4[1 ] =8 ; - -/*FALLTHROUGH*/ + fallthrough;case S3_SAVAGE2000 : videoRam = RamSavage4[(config1 &0xE0 ) >>5 ] *1024 ;
drivers/video/fbdev/sh_mobile_lcdcfb.c +2 -2
@@ -1594,7 +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 */ + fallthrough;case V4L2_PIX_FMT_NV16 :case V4L2_PIX_FMT_NV61 : info->fix.xpanstep =2 ;
@@ -2085,7 +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 */ + fallthrough;case V4L2_PIX_FMT_NV16 :case V4L2_PIX_FMT_NV61 : info->fix.xpanstep =2 ;
drivers/video/fbdev/sm501fb.c +1 -1
@@ -1005,7 +1005,7 @@ static int sm501fb_blank_crt(int blank_mode, struct fb_info *info)case FB_BLANK_POWERDOWN : ctrl &= ~SM501_DC_CRT_CONTROL_ENABLE ;sm501_misc_control (fbi->dev->parent,SM501_MISC_DAC_POWER ,0 ); -/* fall through */ + fallthrough;case FB_BLANK_NORMAL : ctrl |=SM501_DC_CRT_CONTROL_BLANK ;
drivers/video/fbdev/tdfxfb.c +1 -1
@@ -523,7 +523,7 @@ static int tdfxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)case 32 : var->transp.offset =24 ; var->transp.length =8 ; -/* fall through */ + fallthrough;case 24 : var->red.offset =16 ; var->green.offset =8 ;
drivers/video/fbdev/xen-fbfront.c +1 -1
@@ -677,7 +677,7 @@ static void xenfb_backend_changed(struct xenbus_device *dev,case XenbusStateClosed:if (dev->state == XenbusStateClosed)break ; -/* fall through - Missed the backend's CLOSING state. */ + fallthrough;/* Missed the backend's CLOSING state */ case XenbusStateClosing:xenbus_frontend_closed (dev);break ;
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines · Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case.
Signed-off-by Gustavo A. R. Silva <[email protected]>
Thanks.
Fixed indent in arcfb.c while applying. Applied to drm-misc-next and it will appear in 5.10
Sam
Quoted 507 lines
--- drivers/video/fbdev/acornfb.c | 2 +- drivers/video/fbdev/arcfb.c | 2 +- drivers/video/fbdev/atmel_lcdfb.c | 4 ++-- drivers/video/fbdev/aty/radeon_pm.c | 6 +++--- drivers/video/fbdev/cirrusfb.c | 4 ++-- drivers/video/fbdev/controlfb.c | 2 +- drivers/video/fbdev/core/fbmem.c | 2 +- drivers/video/fbdev/fsl-diu-fb.c | 4 ++-- drivers/video/fbdev/gxt4500.c | 2 +- drivers/video/fbdev/i740fb.c | 2 +- drivers/video/fbdev/offb.c | 4 ++-- drivers/video/fbdev/omap/lcdc.c | 4 ++-- drivers/video/fbdev/omap/omapfb_main.c | 20 +++++++++---------- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 4 ++-- .../video/fbdev/omap2/omapfb/omapfb-ioctl.c | 2 +- .../video/fbdev/omap2/omapfb/omapfb-main.c | 2 +- drivers/video/fbdev/pm2fb.c | 4 ++-- drivers/video/fbdev/pxafb.c | 2 +- drivers/video/fbdev/s3c-fb.c | 6 +++--- drivers/video/fbdev/sa1100fb.c | 2 +- drivers/video/fbdev/savage/savagefb_driver.c | 3 +-- drivers/video/fbdev/sh_mobile_lcdcfb.c | 4 ++-- drivers/video/fbdev/sm501fb.c | 2 +- drivers/video/fbdev/tdfxfb.c | 2 +- drivers/video/fbdev/xen-fbfront.c | 2 +- 25 files changed, 46 insertions(+), 47 deletions(-)drivers/video/fbdev/acornfb.c +1
-1@@ -857,7 +857,7 @@ static void acornfb_parse_dram(char *opt)case 'M' :case 'm' : size *=1024 ; -/* Fall through */ + fallthrough;case 'K' :case 'k' : size *=1024 ;drivers/video/fbdev/arcfb.c +1
-1@@ -419,7 +419,7 @@ static int arcfb_ioctl(struct fb_info *info,schedule ();finish_wait (&arcfb_waitq, &wait); } -/* fall through */ + fallthrough;case FBIO_GETCONTROL2 : {drivers/video/fbdev/atmel_lcdfb.c +2
-2@@ -508,7 +508,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,case 32 : var->transp.offset =24 ; var->transp.length =8 ; -/* fall through */ + fallthrough;case 24 :if (pdata->lcd_wiring_mode =ATMEL_LCDC_WIRING_RGB ) {/* RGB:888 mode */ @@ -633,7 +633,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)case 2 : value |=ATMEL_LCDC_PIXELSIZE_2 ;break ;case 4 : value |=ATMEL_LCDC_PIXELSIZE_4 ;break ;case 8 : value |=ATMEL_LCDC_PIXELSIZE_8 ;break ; -case 15 :/* fall through */ +case 15 : fallthrough;case 16 : value |=ATMEL_LCDC_PIXELSIZE_16 ;break ;case 24 : value |=ATMEL_LCDC_PIXELSIZE_24 ;break ;case 32 : value |=ATMEL_LCDC_PIXELSIZE_32 ;break ;drivers/video/fbdev/aty/radeon_pm.c +3
-3@@ -1208,11 +1208,11 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)case 1 :if (mc &0x4 )break ; -/* fall through */ + fallthrough;case 2 : dll_sleep_mask |=MDLL_R300_RDCK__MRDCKB_SLEEP ; dll_reset_mask |=MDLL_R300_RDCK__MRDCKB_RESET ; -/* fall through */ + fallthrough;case 0 : dll_sleep_mask |=MDLL_R300_RDCK__MRDCKA_SLEEP ; dll_reset_mask |=MDLL_R300_RDCK__MRDCKA_RESET ;@@ -1221,7 +1221,7 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)case 1 :if (!(mc &0x4 ))break ; -/* fall through */ + fallthrough;case 2 : dll_sleep_mask |=MDLL_R300_RDCK__MRDCKD_SLEEP ; dll_reset_mask |=MDLL_R300_RDCK__MRDCKD_RESET ;drivers/video/fbdev/cirrusfb.c +2
-2@@ -1476,11 +1476,11 @@ static void init_vgachip(struct fb_info *info)mdelay (100 );/* mode */ vga_wgfx (cinfo->regbase,CL_GR31 ,0x00 ); -/* fall through */ + fallthrough;case BT_GD5480 :/* from Klaus' NetBSD driver: */ vga_wgfx (cinfo->regbase,CL_GR2F ,0x00 ); -/* fall through */ + fallthrough;case BT_ALPINE :/* put blitter into 542x compat */ vga_wgfx (cinfo->regbase,CL_GR33 ,0x00 );drivers/video/fbdev/controlfb.c +1
-1@@ -713,7 +713,7 @@ static int controlfb_blank(int blank_mode, struct fb_info *info)break ;case FB_BLANK_POWERDOWN : ctrl &= ~0x33 ; -/* fall through */ + fallthrough;case FB_BLANK_NORMAL : ctrl |=0x400 ;break ;drivers/video/fbdev/core/fbmem.c +1
-1@@ -1310,7 +1310,7 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd,case FBIOGET_CON2FBMAP :case FBIOPUT_CON2FBMAP : arg = (unsigned long )compat_ptr (arg); -/* fall through */ + fallthrough;case FBIOBLANK : ret =do_fb_ioctl (info, cmd, arg);break ;drivers/video/fbdev/fsl-diu-fb.c +2
-2@@ -1287,7 +1287,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,dev_warn (info->dev,"MFB_SET_PIXFMT value of 0x%08x is deprecated.\n" ,MFB_SET_PIXFMT_OLD ); -/* fall through */ + fallthrough;case MFB_SET_PIXFMT :if (copy_from_user (&pix_fmt, buf,sizeof (pix_fmt)))return -EFAULT ;@@ -1297,7 +1297,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,dev_warn (info->dev,"MFB_GET_PIXFMT value of 0x%08x is deprecated.\n" ,MFB_GET_PIXFMT_OLD ); -/* fall through */ + fallthrough;case MFB_GET_PIXFMT : pix_fmt = ad->pix_fmt;if (copy_to_user (buf, &pix_fmt,sizeof (pix_fmt)))drivers/video/fbdev/gxt4500.c +1
-1@@ -534,7 +534,7 @@ static int gxt4500_setcolreg(unsigned int reg, unsigned int red,break ;case DFA_PIX_32BIT : val |= (reg <<24 ); -/* fall through */ + fallthrough;case DFA_PIX_24BIT : val |= (reg <<16 ) | (reg <<8 );break ;drivers/video/fbdev/i740fb.c +1
-1@@ -430,7 +430,7 @@ static int i740fb_decode_var(const struct fb_var_screeninfo *var,break ; case 9 ... 15: bpp =15 ; -/* fall through */ + fallthrough;case 16 :if ((1000000 / var->pixclock) >DACSPEED16 ) { dev_err(info->device, "requested pixclock %i MHz out of range (max. %i MHz at 15/16bpp)\n",drivers/video/fbdev/offb.c +2
-2@@ -141,7 +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 */ + fallthrough;case cmap_r128:/* Set palette index & data */ out_8 (par->cmap_adr +0xb0 , regno);@@ -211,7 +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 */ + fallthrough;case cmap_r128:/* Set palette index & data */ out_8 (par->cmap_adr +0xb0 , i);drivers/video/fbdev/omap/lcdc.c +2
-2@@ -328,13 +328,13 @@ static int omap_lcdc_setup_plane(int plane, int channel_out, lcdc.bpp =12 ;break ; } -/* fallthrough */ + fallthrough;case OMAPFB_COLOR_YUV422 :if (lcdc.ext_mode) { lcdc.bpp =16 ;break ; } -/* fallthrough */ + fallthrough;default :/* FIXME: other BPPs. * bpp1: code 0, size 256 drivers/video/fbdev/omap/omapfb_main.c +10
-10@@ -253,7 +253,7 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green,if (fbdev->ctrl->setcolreg) r = fbdev->ctrl->setcolreg (regno, red, green, blue, transp, update_hw_pal); -/* Fallthrough */ + fallthrough;case OMAPFB_COLOR_RGB565 :case OMAPFB_COLOR_RGB444 :if (r !=0 )@@ -443,7 +443,7 @@ static int set_color_mode(struct omapfb_plane_struct *plane,return 0 ;case 12 : var->bits_per_pixel =16 ; -/* fall through */ + fallthrough;case 16 :if (plane->fbdev->panel->bpp =12 ) plane->color_mode =OMAPFB_COLOR_RGB444 ;@@ -1531,27 +1531,27 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)case OMAPFB_ACTIVE :for (i =0 ; i < fbdev->mem_desc.region_cnt; i++)unregister_framebuffer (fbdev->fb_info[i]); -/* fall through */ + fallthrough;case 7 :omapfb_unregister_sysfs (fbdev); -/* fall through */ + fallthrough;case 6 :if (fbdev->panel->disable) fbdev->panel->disable (fbdev->panel); -/* fall through */ + fallthrough;case 5 :omapfb_set_update_mode (fbdev,OMAPFB_UPDATE_DISABLED ); -/* fall through */ + fallthrough;case 4 :planes_cleanup (fbdev); -/* fall through */ + fallthrough;case 3 :ctrl_cleanup (fbdev); -/* fall through */ + fallthrough;case 2 :if (fbdev->panel->cleanup) fbdev->panel->cleanup (fbdev->panel); -/* fall through */ + fallthrough;case 1 :dev_set_drvdata (fbdev->dev,NULL );kfree (fbdev);@@ -1854,7 +1854,7 @@ static int __init omapfb_setup(char *options)case 'm' :case 'M' : vram *=1024 ; -/* Fall through */ + fallthrough;case 'k' :case 'K' : vram *=1024 ;drivers/video/fbdev/omap2/omapfb/dss/dispc.c +2
-2@@ -1858,7 +1858,7 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,if (color_mode =OMAP_DSS_COLOR_YUV2 || color_mode =OMAP_DSS_COLOR_UYVY ) width = width >>1 ; -/* fall through */ + fallthrough;case OMAP_DSS_ROT_90 :case OMAP_DSS_ROT_270 : *offset1 =0 ;@@ -1881,7 +1881,7 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,if (color_mode =OMAP_DSS_COLOR_YUV2 || color_mode =OMAP_DSS_COLOR_UYVY ) width = width >>1 ; -/* fall through */ + fallthrough;case OMAP_DSS_ROT_90 +4 :case OMAP_DSS_ROT_270 +4 : *offset1 =0 ;drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +1
-1@@ -760,7 +760,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) r = -ENODEV ;break ; } -/* FALLTHROUGH */ + fallthrough;case OMAPFB_WAITFORVSYNC :DBG ("ioctl WAITFORVSYNC\n" );drivers/video/fbdev/omap2/omapfb/omapfb-main.c +1
-1@@ -882,7 +882,7 @@ int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl, / (var->bits_per_pixel >> 2);break ; } -/* fall through */ + fallthrough;default : screen_width = fix->line_length / (var->bits_per_pixel >>3 );break ;drivers/video/fbdev/pm2fb.c +2
-2@@ -233,10 +233,10 @@ static u32 to3264(u32 timing, int bpp, int is64)switch (bpp) {case 24 : timing *=3 ; -/* fall through */ + fallthrough;case 8 : timing >>=1 ; -/* fall through */ + fallthrough;case 16 : timing >>=1 ;case 32 :drivers/video/fbdev/pxafb.c +1
-1@@ -1614,7 +1614,7 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state)*/ if (old_state !=C_DISABLE_PM )break ; -/* fall through */ + fallthrough;case C_ENABLE :/* drivers/video/fbdev/s3c-fb.c +3
-3@@ -284,7 +284,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,/* 666 with one bit alpha/transparency */ var->transp.offset =18 ; var->transp.length =1 ; -/* fall through */ + fallthrough;case 18 : var->bits_per_pixel =32 ;@@ -312,7 +312,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,case 25 : var->transp.length = var->bits_per_pixel -24 ; var->transp.offset =24 ; -/* fall through */ + fallthrough;case 24 :/* our 24bpp is unpacked, so 32bpp */ var->bits_per_pixel =32 ;@@ -809,7 +809,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)case FB_BLANK_POWERDOWN : wincon &= ~WINCONx_ENWIN; sfb->enabled &= ~(1 << index); -/* fall through - to FB_BLANK_NORMAL */ + fallthrough;/* to FB_BLANK_NORMAL */ case FB_BLANK_NORMAL :/* disable the DMA and display 0x0 (black) */ drivers/video/fbdev/sa1100fb.c +1
-1@@ -935,7 +935,7 @@ static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state)*/ if (old_state !=C_DISABLE_PM )break ; -/* fall through */ + fallthrough;case C_ENABLE :/* drivers/video/fbdev/savage/savagefb_driver.c +1
-2@@ -1859,8 +1859,7 @@ static int savage_init_hw(struct savagefb_par *par)vga_out8 (0x3d4 ,0x68 , par);/* memory control 1 */ if ((vga_in8 (0x3d5 , par) &0xC0 ) = (0x01 <<6 )) RamSavage4[1 ] =8 ; - -/*FALLTHROUGH*/ + fallthrough;case S3_SAVAGE2000 : videoRam = RamSavage4[(config1 &0xE0 ) >>5 ] *1024 ;drivers/video/fbdev/sh_mobile_lcdcfb.c +2
-2@@ -1594,7 +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 */ + fallthrough;case V4L2_PIX_FMT_NV16 :case V4L2_PIX_FMT_NV61 : info->fix.xpanstep =2 ;@@ -2085,7 +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 */ + fallthrough;case V4L2_PIX_FMT_NV16 :case V4L2_PIX_FMT_NV61 : info->fix.xpanstep =2 ;drivers/video/fbdev/sm501fb.c +1
-1@@ -1005,7 +1005,7 @@ static int sm501fb_blank_crt(int blank_mode, struct fb_info *info)case FB_BLANK_POWERDOWN : ctrl &= ~SM501_DC_CRT_CONTROL_ENABLE ;sm501_misc_control (fbi->dev->parent,SM501_MISC_DAC_POWER ,0 ); -/* fall through */ + fallthrough;case FB_BLANK_NORMAL : ctrl |=SM501_DC_CRT_CONTROL_BLANK ;drivers/video/fbdev/tdfxfb.c +1
-1@@ -523,7 +523,7 @@ static int tdfxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)case 32 : var->transp.offset =24 ; var->transp.length =8 ; -/* fall through */ + fallthrough;case 24 : var->red.offset =16 ; var->green.offset =8 ;drivers/video/fbdev/xen-fbfront.c +1
-1@@ -677,7 +677,7 @@ static void xenfb_backend_changed(struct xenbus_device *dev,case XenbusStateClosed:if (dev->state = XenbusStateClosed)break ; -/* fall through - Missed the backend's CLOSING state. */ + fallthrough;/* Missed the backend's CLOSING state */ case XenbusStateClosing:xenbus_frontend_closed (dev);break ;Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Sam Ravnborg
Quoted 4 lines · Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case.
Quoted 9 lines
Quoted 3 lines
Signed-off-by Gustavo A. R. Silva <[email protected]>Thanks.
Fixed indent in
arcfb.cwhile applying. Applied to drm-misc-next and it will appear in 5.10
Thank you, Sam. :)
--
Gustavo
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 5 lines · Sam Ravnborg
Quoted 4 lines · Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case.
Quoted 8 lines
Quoted 3 lines
Signed-off-by Gustavo A. R. Silva <[email protected]>Thanks.
Fixed indent in
arcfb.cwhile applying. Applied to drm-misc-next and it will appear in 5.10
Perhaps better would be to fix all the switch / case brace uses so that it looks more typical kernel style.
Quoted 11 lines
Quoted 11 lines
drivers/video/fbdev/arcfb.c +1
-1@@ -419,7 +419,7 @@ static int arcfb_ioctl(struct fb_info *info,schedule ();finish_wait (&arcfb_waitq, &wait); } -/* fall through */ + fallthrough;
Quoted 2 lines
drivers/video/fbdev/arcfb.c static int arcfb_ioctl(struct fb_info *info, · line 425
Quoted 2 lines
drivers/video/fbdev/arcfb.c +0
-0case FBIO_GETCONTROL2 : {
--- drivers/video/fbdev/arcfb.c | 52 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 27 deletions(-)
drivers/video/fbdev/arcfb.c +25 -27
@@ -403,35 +403,33 @@ static int arcfb_ioctl(struct fb_info *info,unsigned long flags;switch (cmd) { -case FBIO_WAITEVENT : - { -DEFINE_WAIT (wait); -/* illegal to wait on arc if no irq will occur */ -if (!par->irq) -return -EINVAL ; - -/* wait until the Arc has generated an interrupt -* which will wake us up */ -spin_lock_irqsave (&par->lock, flags); -prepare_to_wait (&arcfb_waitq, &wait, -TASK_INTERRUPTIBLE ); -spin_unlock_irqrestore (&par->lock, flags); -schedule (); -finish_wait (&arcfb_waitq, &wait); - } -/* fall through */ +case FBIO_WAITEVENT : { +DEFINE_WAIT (wait); +/* illegal to wait on arc if no irq will occur */ +if (!par->irq) +return -EINVAL ; -case FBIO_GETCONTROL2 : - { -unsigned char ctl2; +/* wait until the Arc has generated an interrupt +* which will wake us up */ +spin_lock_irqsave (&par->lock, flags); +prepare_to_wait (&arcfb_waitq, &wait,TASK_INTERRUPTIBLE ); +spin_unlock_irqrestore (&par->lock, flags); +schedule (); +finish_wait (&arcfb_waitq, &wait); + fallthrough; + } - ctl2 =ks108_readb_ctl2 (info->par); -if (copy_to_user (argp, &ctl2,sizeof (ctl2))) -return -EFAULT ; -return 0 ; - } -default : -return -EINVAL ; +case FBIO_GETCONTROL2 : { +unsigned char ctl2; + + ctl2 =ks108_readb_ctl2 (info->par); +if (copy_to_user (argp, &ctl2,sizeof (ctl2))) +return -EFAULT ; +return 0 ; + } + +default : +return -EINVAL ; } }
Quoted 10 lines · Joe Perches
Quoted 9 lines · Sam Ravnborg
Quoted 7 lines · Gustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case.
Signed-off-by Gustavo A. R. Silva <[email protected]>
Quoted 7 lines
Quoted 4 lines
Thanks.
Fixed indent in
arcfb.cwhile applying. Applied to drm-misc-next and it will appear in 5.10Perhaps better would be to fix all the switch / case brace uses so that it looks more typical kernel style.
falltrhough seems like an OK thing to do even if fbdev is in pure maintenance mode. Mostly so tools do not stumble upon this and we continue to see patches.
But larger refactorings seems a little pointless.
If we do this change, should we then also start to accept indent fixes for the other switch () cases in the fbdev drivers.
My initial reaction is therefore thanks, but no thanks.
Sam
Quoted 85 lines
Quoted 12 lines
Quoted 12 lines
drivers/video/fbdev/arcfb.c +1
-1@@ -419,7 +419,7 @@ static int arcfb_ioctl(struct fb_info *info,schedule ();finish_wait (&arcfb_waitq, &wait); } -/* fall through */ + fallthrough;Quoted 2 lines
drivers/video/fbdev/arcfb.c static int arcfb_ioctl(struct fb_info *info, · line 425
Quoted 2 lines
drivers/video/fbdev/arcfb.c +0
-0case FBIO_GETCONTROL2 : {--- drivers/video/fbdev/arcfb.c | 52 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 27 deletions(-)drivers/video/fbdev/arcfb.c +25
-27@@ -403,35 +403,33 @@ static int arcfb_ioctl(struct fb_info *info,unsigned long flags;switch (cmd) { -case FBIO_WAITEVENT : - { -DEFINE_WAIT (wait); -/* illegal to wait on arc if no irq will occur */ -if (!par->irq) -return -EINVAL ; - -/* wait until the Arc has generated an interrupt -* which will wake us up */ -spin_lock_irqsave (&par->lock, flags); -prepare_to_wait (&arcfb_waitq, &wait, -TASK_INTERRUPTIBLE ); -spin_unlock_irqrestore (&par->lock, flags); -schedule (); -finish_wait (&arcfb_waitq, &wait); - } -/* fall through */ +case FBIO_WAITEVENT : { +DEFINE_WAIT (wait); +/* illegal to wait on arc if no irq will occur */ +if (!par->irq) +return -EINVAL ; -case FBIO_GETCONTROL2 : - { -unsigned char ctl2; +/* wait until the Arc has generated an interrupt +* which will wake us up */ +spin_lock_irqsave (&par->lock, flags); +prepare_to_wait (&arcfb_waitq, &wait,TASK_INTERRUPTIBLE ); +spin_unlock_irqrestore (&par->lock, flags); +schedule (); +finish_wait (&arcfb_waitq, &wait); + fallthrough; + } - ctl2 =ks108_readb_ctl2 (info->par); -if (copy_to_user (argp, &ctl2,sizeof (ctl2))) -return -EFAULT ; -return 0 ; - } -default : -return -EINVAL ; +case FBIO_GETCONTROL2 : { +unsigned char ctl2; + + ctl2 =ks108_readb_ctl2 (info->par); +if (copy_to_user (argp, &ctl2,sizeof (ctl2))) +return -EFAULT ; +return 0 ; + } + +default : +return -EINVAL ; } }