staging: sm750fb: fix all checkpatch warnings in .c and .h files
PATCH 1/1 staging: sm750fb: fix all checkpatch warnings in .c and .h files
This patch resolves all checkpatch.pl --strict warnings in the sm750fb driver source files, including both C and header files.
Changes include:
- Replacing CamelCase identifiers with snake_case
- Avoiding chained assignments
- Fixing indentation, spacing, and alignment issues
- Updating function declarations and comment styles
- Making code conform to kernel coding style
No functional changes.
--- drivers/staging/sm750fb/sm750.c | 90 ++++++++++--------- drivers/staging/sm750fb/sm750.h | 32 +++---- drivers/staging/sm750fb/sm750_accel.c | 120 +++++++++++++------------- drivers/staging/sm750fb/sm750_hw.c | 24 +++--- 4 files changed, 135 insertions(+), 131 deletions(-)
drivers/staging/sm750fb/sm750.c +47 -43
@@ -33,7 +33,7 @@static int g_hwcursor =1 ;static int g_noaccel;static int g_nomtrr; -static const char *const g_fbmode[] = {NULL ,NULL }; +static const char *g_fbmode[] = {NULL ,NULL };static const char *g_def_fbmode ="1024x768-32@60" ;static char *g_settings;static int g_dualview;
@@ -160,7 +160,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info, {struct lynxfb_par *par;struct sm750_dev *sm750_dev; -unsigned int base, pitch, Bpp, rop; +unsigned int base, pitch, bpp, rop;u32 color;if (info->state !=FBINFO_STATE_RUNNING )
@@ -175,9 +175,9 @@ static void lynxfb_ops_fillrect(struct fb_info *info,*/ base = par->crtc.o_screen; pitch = info->fix.line_length; - Bpp = info->var.bits_per_pixel >>3 ; + bpp = info->var.bits_per_pixel >>3 ; - color = (Bpp ==1 ) ? region->color : + color = (bpp ==1 ) ? region->color : ((u32 *)info->pseudo_palette)[region->color]; rop = (region->rop !=ROP_COPY ) ?HW_ROP2_XOR :HW_ROP2_COPY ;
@@ -190,7 +190,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,spin_lock (&sm750_dev->slock); sm750_dev->accel.de_fillrect (&sm750_dev->accel, - base, pitch, Bpp, + base, pitch, bpp, region->dx, region->dy, region->width, region->height, color, rop);
@@ -202,7 +202,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info, {struct lynxfb_par *par;struct sm750_dev *sm750_dev; -unsigned int base, pitch, Bpp; +unsigned int base, pitch, bpp; par = info->par; sm750_dev = par->dev;
@@ -213,7 +213,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,*/ base = par->crtc.o_screen; pitch = info->fix.line_length; - Bpp = info->var.bits_per_pixel >>3 ; + bpp = info->var.bits_per_pixel >>3 ;/* * If not use spin_lock, system will die if user load driver
@@ -225,7 +225,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info, sm750_dev->accel.de_copyarea (&sm750_dev->accel, base, pitch, region->sx, region->sy, - base, pitch, Bpp, region->dx, region->dy, + base, pitch, bpp, region->dx, region->dy, region->width, region->height,HW_ROP2_COPY );spin_unlock (&sm750_dev->slock);
@@ -234,7 +234,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,static void lynxfb_ops_imageblit (struct fb_info *info,const struct fb_image *image) { -unsigned int base, pitch, Bpp; +unsigned int base, pitch, bpp;unsigned int fgcol, bgcol;struct lynxfb_par *par;struct sm750_dev *sm750_dev;
@@ -247,7 +247,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,*/ base = par->crtc.o_screen; pitch = info->fix.line_length; - Bpp = info->var.bits_per_pixel >>3 ; + bpp = info->var.bits_per_pixel >>3 ;/* TODO: Implement hardware acceleration for image->depth > 1 */ if (image->depth !=1 ) {
@@ -274,7 +274,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info, sm750_dev->accel.de_imageblit (&sm750_dev->accel, image->data, image->width >>3 ,0 , - base, pitch, Bpp, + base, pitch, bpp, image->dx, image->dy, image->width, image->height, fgcol, bgcol,HW_ROP2_COPY );
@@ -526,6 +526,7 @@ static int lynxfb_ops_setcolreg(unsigned int regno,struct lynxfb_crtc *crtc;struct fb_var_screeninfo *var;int ret; +int gray; par = info->par; crtc = &par->crtc;
@@ -538,7 +539,10 @@ static int lynxfb_ops_setcolreg(unsigned int regno, }if (info->var.grayscale) - red = green = blue = (red *77 + green *151 + blue *28 ) >>8 ; + gray = (red *77 + green *151 + blue *28 ) >>8 ; + red = gray; + green = gray; + blue = gray;if (var->bits_per_pixel ==8 && info->fix.visual ==FB_VISUAL_PSEUDOCOLOR ) {
@@ -577,7 +581,7 @@ static int lynxfb_ops_blank(int blank, struct fb_info *info)pr_debug ("blank = %d.\n" , blank); par = info->par; output = &par->output; -return output->proc_setBLANK (output, blank); +return output->proc_set_BLANK (output, blank); }static int sm750fb_set_drv (struct lynxfb_par *par)
@@ -598,14 +602,14 @@ static int sm750fb_set_drv(struct lynxfb_par *par) crtc->vidmem_size >>=1 ;/* setup crtc and output member */ - sm750_dev->hwCursor = g_hwcursor; + sm750_dev->hw_cursor = g_hwcursor; crtc->line_pad =16 ; crtc->xpanstep =8 ; crtc->ypanstep =1 ; crtc->ywrapstep =0 ; - output->proc_setBLANK = (sm750_dev->revid ==SM750LE_REVISION_ID ) ? + output->proc_set_BLANK = (sm750_dev->revid ==SM750LE_REVISION_ID ) ? hw_sm750le_set_blank : hw_sm750_set_blank;/* chip specific phase */ sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ?
@@ -615,27 +619,27 @@ static int sm750fb_set_drv(struct lynxfb_par *par) output->paths = sm750_pnc; crtc->channel = sm750_primary; crtc->o_screen =0 ; - crtc->v_screen = sm750_dev->pvMem; + crtc->v_screen = sm750_dev->pv_mem;pr_info ("use simul primary mode\n" );break ;case sm750_simul_sec: output->paths = sm750_pnc; crtc->channel = sm750_secondary; crtc->o_screen =0 ; - crtc->v_screen = sm750_dev->pvMem; + crtc->v_screen = sm750_dev->pv_mem;break ;case sm750_dual_normal:if (par->index ==0 ) { output->paths = sm750_panel; crtc->channel = sm750_primary; crtc->o_screen =0 ; - crtc->v_screen = sm750_dev->pvMem; + crtc->v_screen = sm750_dev->pv_mem; }else { output->paths = sm750_crt; crtc->channel = sm750_secondary;/* not consider of padding stuffs for o_screen,need fix */ crtc->o_screen = sm750_dev->vidmem_size >>1 ; - crtc->v_screen = sm750_dev->pvMem + crtc->o_screen; + crtc->v_screen = sm750_dev->pv_mem + crtc->o_screen; }break ;case sm750_dual_swap:
@@ -643,7 +647,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) output->paths = sm750_panel; crtc->channel = sm750_secondary; crtc->o_screen =0 ; - crtc->v_screen = sm750_dev->pvMem; + crtc->v_screen = sm750_dev->pv_mem; }else { output->paths = sm750_crt; crtc->channel = sm750_primary;
@@ -651,7 +655,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)* need fix */ crtc->o_screen = sm750_dev->vidmem_size >>1 ; - crtc->v_screen = sm750_dev->pvMem + crtc->o_screen; + crtc->v_screen = sm750_dev->pv_mem + crtc->o_screen; }break ;default :
@@ -731,7 +735,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) "kernel HELPERS prepared vesa_modes", }; -static const char *fixId[2 ] = { +static const char *fix_id[2 ] = {"sm750_fb1" ,"sm750_fb2" , };
@@ -755,14 +759,14 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)* must be set after crtc member initialized */ crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size -1024 ; - crtc->cursor.mmio = sm750_dev->pvReg + + crtc->cursor.mmio = sm750_dev->pv_reg +0x800f0 + (int )crtc->channel *0x140 ;pr_info ("crtc->cursor.mmio = %p\n" , crtc->cursor.mmio); crtc->cursor.max_h =64 ; crtc->cursor.max_w =64 ; crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w *2 /8 ; - crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset; + crtc->cursor.vstart = sm750_dev->pv_mem + crtc->cursor.offset;memset_io (crtc->cursor.vstart,0 , crtc->cursor.size);if (!g_hwcursor)
@@ -853,7 +857,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) fix->ywrapstep = crtc->ywrapstep; fix->accel =FB_ACCEL_SMI ; -strscpy (fix->id, fixId[index],sizeof (fix->id)); +strscpy (fix->id, fix_id[index],sizeof (fix->id)); fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;pr_info ("fix->smem_start = %lx\n" , fix->smem_start);
@@ -909,12 +913,12 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src) swap =0 ; - sm750_dev->initParm.chip_clk =0 ; - sm750_dev->initParm.mem_clk =0 ; - sm750_dev->initParm.master_clk =0 ; - sm750_dev->initParm.powerMode =0 ; - sm750_dev->initParm.setAllEngOff =0 ; - sm750_dev->initParm.resetMemory =1 ; + sm750_dev->init_parm.chip_clk =0 ; + sm750_dev->init_parm.mem_clk =0 ; + sm750_dev->init_parm.master_clk =0 ; + sm750_dev->init_parm.power_mode =0 ; + sm750_dev->init_parm.set_all_eng_off =0 ; + sm750_dev->init_parm.reset_memory =1 ;/* defaultly turn g_hwcursor on for both view */ g_hwcursor =3 ;
@@ -933,11 +937,11 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src) }else if (!strncmp (opt,"nocrt" ,strlen ("nocrt" ))) { sm750_dev->nocrt =1 ; }else if (!strncmp (opt,"36bit" ,strlen ("36bit" ))) { - sm750_dev->pnltype = sm750_doubleTFT; + sm750_dev->pnl_type = sm750_double_TFT; }else if (!strncmp (opt,"18bit" ,strlen ("18bit" ))) { - sm750_dev->pnltype = sm750_dualTFT; + sm750_dev->pnl_type = sm750_dual_TFT; }else if (!strncmp (opt,"24bit" ,strlen ("24bit" ))) { - sm750_dev->pnltype = sm750_24TFT; + sm750_dev->pnl_type = sm750_24TFT; }else if (!strncmp (opt,"nohwc0" ,strlen ("nohwc0" ))) { g_hwcursor &= ~0x1 ; }else if (!strncmp (opt,"nohwc1" ,strlen ("nohwc1" ))) {
@@ -963,20 +967,20 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)if (sm750_dev->revid !=SM750LE_REVISION_ID ) {if (sm750_dev->fb_count >1 ) {if (swap) - sm750_dev->dataflow = sm750_dual_swap; + sm750_dev->data_flow = sm750_dual_swap;else - sm750_dev->dataflow = sm750_dual_normal; + sm750_dev->data_flow = sm750_dual_normal; }else {if (swap) - sm750_dev->dataflow = sm750_simul_sec; + sm750_dev->data_flow = sm750_simul_sec;else - sm750_dev->dataflow = sm750_simul_pri; + sm750_dev->data_flow = sm750_simul_pri; } }else {/* SM750LE only have one crt channel */ - sm750_dev->dataflow = sm750_simul_sec; + sm750_dev->data_flow = sm750_simul_sec;/* sm750le do not have complex attributes */ - sm750_dev->nocrt =0 ; + sm750_dev->no_crt =0 ; } }
@@ -1081,7 +1085,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, sm750_dev->mtrr.vram =arch_phys_wc_add (sm750_dev->vidmem_start, sm750_dev->vidmem_size); -memset_io (sm750_dev->pvMem,0 , sm750_dev->vidmem_size); +memset_io (sm750_dev->pv_mem,0 , sm750_dev->vidmem_size);pci_set_drvdata (pdev, sm750_dev);
@@ -1112,8 +1116,8 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)sm750fb_framebuffer_release (sm750_dev);arch_phys_wc_del (sm750_dev->mtrr.vram); -iounmap (sm750_dev->pvReg); -iounmap (sm750_dev->pvMem); +iounmap (sm750_dev->pv_reg); +iounmap (sm750_dev->pv_mem);kfree (g_settings); }
drivers/staging/sm750fb/sm750.h +16 -16
@@ -13,9 +13,9 @@#endif enum sm750_pnltype { - sm750_24TFT =0 ,/* 24bit tft */ - sm750_dualTFT =2 ,/* dual 18 bit tft */ - sm750_doubleTFT =1 ,/* 36 bit double pixel tft */ + sm750_24_TFT =0 ,/* 24bit tft */ + sm750_dual_TFT =2 ,/* dual 18 bit tft */ + sm750_double_TFT =1 ,/* 36 bit double pixel tft */ };/* vga channel is not concerned */
@@ -39,20 +39,20 @@ enum sm750_path { };struct init_status { -ushort powerMode; +ushort power_mode;/* below three clocks are in unit of MHZ*/ ushort chip_clk;ushort mem_clk;ushort master_clk; -ushort setAllEngOff; -ushort resetMemory; +ushort set_all_eng_off; +ushort reset_memory; };struct lynx_accel {/* base virtual address of DPR registers */ -volatile unsigned char __iomem *dprBase; +volatile unsigned char __iomem *dpr_base;/* base virtual address of de data port */ -volatile unsigned char __iomem *dpPortBase; +volatile unsigned char __iomem *dp_port_base;/* function pointers */ void (*de_init)(struct lynx_accel *accel);
@@ -97,15 +97,15 @@ struct sm750_dev {unsigned long vidreg_start;__u32 vidmem_size;__u32 vidreg_size; -void __iomem *pvReg; -unsigned char __iomem *pvMem; +void __iomem *pv_reg; +unsigned char __iomem *pv_mem;/* locks*/ spinlock_t slock; -struct init_status initParm; -enum sm750_pnltype pnltype; -enum sm750_dataflow dataflow; -int nocrt; +struct init_status init_parm; +enum sm750_pnltype pnl_type; +enum sm750_dataflow data_flow; +int no_crt;/* * 0: no hardware cursor
@@ -113,7 +113,7 @@ struct sm750_dev {* 2: secondary crtc hw cursor enabled * 3: both ctrc hw cursor enabled */ -int hwCursor; +int hw_cursor; };struct lynx_cursor {
@@ -170,7 +170,7 @@ struct lynxfb_output {*/ void *priv; -int (*proc_setBLANK)(struct lynxfb_output *output,int blank); +int (*proc_set_BLANK)(struct lynxfb_output *output,int blank); };struct lynxfb_par {
drivers/staging/sm750fb/sm750_accel.c +60 -60
297 lines not on this page · raw message
drivers/staging/sm750fb/sm750_hw.c +12 -12
@@ -49,19 +49,19 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev) }/* now map mmio and vidmem */ - sm750_dev->pvReg = + sm750_dev->pv_reg =ioremap (sm750_dev->vidreg_start, sm750_dev->vidreg_size); -if (!sm750_dev->pvReg) { +if (!sm750_dev->pv_reg) {pr_err ("mmio failed\n" ); ret = -EFAULT ; goto exit; } -pr_info ("mmio virtual addr = %p\n" , sm750_dev->pvReg); +pr_info ("mmio virtual addr = %p\n" , sm750_dev->pv_reg); - sm750_dev->accel.dprBase = sm750_dev->pvReg +DE_BASE_ADDR_TYPE1 ; - sm750_dev->accel.dpPortBase = sm750_dev->pvReg +DE_PORT_ADDR_TYPE1 ; + sm750_dev->accel.dpr_base = sm750_dev->pv_reg +DE_BASE_ADDR_TYPE1 ; + sm750_dev->accel.dp_port_base = sm750_dev->pv_reg +DE_PORT_ADDR_TYPE1 ; - mmio750 = sm750_dev->pvReg; + mmio750 = sm750_dev->pv_reg;sm750_set_chip_type (sm750_dev->devid, sm750_dev->revid); sm750_dev->vidmem_start =pci_resource_start (pdev,0 );
@@ -76,15 +76,15 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev) sm750_dev->vidmem_start, sm750_dev->vidmem_size);/* reserve the vidmem space of smi adaptor */ - sm750_dev->pvMem = + sm750_dev->pv_mem =ioremap_wc (sm750_dev->vidmem_start, sm750_dev->vidmem_size); -if (!sm750_dev->pvMem) { -iounmap (sm750_dev->pvReg); +if (!sm750_dev->pv_mem) { +iounmap (sm750_dev->pv_reg);pr_err ("Map video memory failed\n" ); ret = -EFAULT ; goto exit; } -pr_info ("video memory vaddr = %p\n" , sm750_dev->pvMem); +pr_info ("video memory vaddr = %p\n" , sm750_dev->pv_mem); exit:return ret; }
@@ -93,7 +93,7 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev) {struct init_status *parm; - parm = &sm750_dev->initParm; + parm = &sm750_dev->init_parm;if (parm->chip_clk ==0 ) parm->chip_clk = (sm750_get_chip_type () ==SM750LE ) ? DEFAULT_SM750LE_CHIP_CLOCK :
@@ -104,7 +104,7 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev)if (parm->master_clk ==0 ) parm->master_clk = parm->chip_clk /3 ; -ddk750_init_hw ((struct initchip_param *)&sm750_dev->initParm); +ddk750_init_hw ((struct initchip_param *)&sm750_dev->init_parm);/* for sm718, open pci burst */ if (sm750_dev->devid ==0x718 ) { poke32(SYSTEM_CTRL,
Signature · 1 line
2.43.0
Greg KH
maintainerQuoted 12 lines · Manish Kumar
This patch resolves all checkpatch.pl --strict warnings in the sm750fb driver source files, including both C and header files.
Changes include:
- Replacing CamelCase identifiers withsnake_case
- Avoiding chained assignments
- Fixing indentation, spacing, and alignment issues
- Updating function declarations and comment styles
- Making code conform to kernel coding styleNo functional changes.
Quoted 7 lines
Signed-off-by Manish Kumar <[email protected]>--- drivers/staging/sm750fb/sm750.c | 90 ++++++++++--------- drivers/staging/sm750fb/sm750.h | 32 +++---- drivers/staging/sm750fb/sm750_accel.c | 120 +++++++++++++------------- drivers/staging/sm750fb/sm750_hw.c | 24 +++--- 4 files changed, 135 insertions(+), 131 deletions(-)
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot
Quoted 25 lines · Manish Kumar
This patch resolves all checkpatch.pl --strict warnings in the sm750fb driver source files, including both C and header files.
Changes include:
- Replacing CamelCase identifiers withsnake_case
- Avoiding chained assignments
- Fixing indentation, spacing, and alignment issues
- Updating function declarations and comment styles
- Making code conform to kernel coding styleNo functional changes.
Signed-off-by Manish Kumar <[email protected]>--- drivers/staging/sm750fb/sm750.c | 90 ++++++++++--------- drivers/staging/sm750fb/sm750.h | 32 +++---- drivers/staging/sm750fb/sm750_accel.c | 120 +++++++++++++------------- drivers/staging/sm750fb/sm750_hw.c | 24 +++--- 4 files changed, 135 insertions(+), 131 deletions(-)drivers/staging/sm750fb/sm750.c +0
-0
drivers/staging/sm750fb/sm750.c line 36
Quoted 5 lines
drivers/staging/sm750fb/sm750.c +1
-1@@ -33,7 +33,7 @@static int g_hwcursor =1 ;static int g_noaccel;static int g_nomtrr; -static const char *const g_fbmode[] = {NULL ,NULL }; +static const char *g_fbmode[] = {NULL ,NULL };
You're removing a patch which we never applied. Start from a fresh tree.
regards,
dan carpenter