staging: sm750fb: fix CamelCase variables name in sm750
PATCH v2 1/1 staging: sm750fb: fix CamelCase variables name in sm750
Replace CamelCase variable name with snake_case:
- pvReg -> pv_reg
- setAllEngOff -> set_all_eng_off
--- drivers/staging/sm750fb/sm750.c | 6 +++--- drivers/staging/sm750fb/sm750.h | 4 ++-- drivers/staging/sm750fb/sm750_hw.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/sm750fb/sm750.c +3 -3
@@ -755,7 +755,7 @@ 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 ; crtc->cursor.max_h =64 ;
@@ -860,7 +860,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src) 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.setAllEngOff =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 */
@@ -1059,7 +1059,7 @@ 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->pv_reg);iounmap (sm750_dev->vmem);pci_release_region (pdev,1 );kfree (g_settings);
drivers/staging/sm750fb/sm750.h +2 -2
@@ -44,7 +44,7 @@ struct init_status {ushort chip_clk;ushort mem_clk;ushort master_clk; -ushort setAllEngOff; +ushort set_all_eng_off;ushort reset_memory; };
@@ -97,7 +97,7 @@ struct sm750_dev {unsigned long vidreg_start;__u32 vidmem_size;__u32 vidreg_size; -void __iomem *pvReg; +void __iomem *pv_reg;unsigned char __iomem *vmem;/* locks*/ spinlock_t slock;
drivers/staging/sm750fb/sm750_hw.c +6 -6
@@ -40,18 +40,18 @@ 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) {dev_err (&pdev->dev,"mmio failed\n" ); ret = -EFAULT ; goto err_release_region; } - sm750_dev->accel.dpr_base = sm750_dev->pvReg +DE_BASE_ADDR_TYPE1 ; - sm750_dev->accel.dp_port_base = 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 );
@@ -75,7 +75,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)return 0 ; err_unmap_reg: -iounmap (sm750_dev->pvReg); +iounmap (sm750_dev->pv_reg); err_release_region:pci_release_region (pdev,1 );return ret;
Signature · 1 line
2.53.0
Greg KH
maintainerQuoted 2 lines · Emmanuel Arias
Replace CamelCase variable name with
snake_case:
- pvReg ->pv_reg
Why are you keeping the "pv_"? What does that mean?
Quoted 3 lines
- setAllEngOff ->
set_all_eng_offReported-by kernel test robot <[email protected]>
The test robot told you to make this change?
Quoted 7 lines
Signed-off-by Emmanuel Arias <[email protected]>--- drivers/staging/sm750fb/sm750.c | 6 +++--- drivers/staging/sm750fb/sm750.h | 4 ++-- drivers/staging/sm750fb/sm750_hw.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-)
What changed from v1?
thanks,
greg k-h
Hi,
thanks for your reply
Quoted 5 lines · Greg KH
Quoted 2 lines · Emmanuel Arias
Replace CamelCase variable name with
snake_case:
- pvReg ->pv_regWhy are you keeping the "
pv_"? What does that mean?
Sorry, I'm trying to start contributing in the kernel. I run
scripts/checkpatch.pl --file drivers/staging/sm750fb/*.c
And the output was:
drivers/staging/sm750fb/sm750.c
-------------------------------
WARNING: static const char * array should probably be static const char
* const
#36: FILE: drivers/staging/sm750fb/sm750.c:36:
+static const char *g_fbmode[] = {NULL, NULL};
CHECK: Avoid CamelCase: <pvReg>
#758: FILE: drivers/staging/sm750fb/sm750.c:758:
+ crtc->cursor.mmio = sm750_dev->pvReg +
CHECK: Avoid CamelCase: <setAllEngOff>
#863: FILE: drivers/staging/sm750fb/sm750.c:863:
+ sm750_dev->init_parm.setAllEngOff = 0;
total: 0 errors, 1 warnings, 2 checks, 1171 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or
--fix-inplace.
So I tried to change pvReg for pv_reg and the same for setAllEngOff.
Quoted 6 lines
Quoted 4 lines
- setAllEngOff ->
set_all_eng_offReported-by kernel test robot <[email protected]>The test robot told you to make this change?
As I understand the test robot failed because:
drivers/staging/sm750fb/sm750_hw.c: In function 'hw_sm750_map':
Quoted 1 line
Quoted 1 line
drivers/staging/sm750fb/sm750_hw.c:43:13: error: 'structsm750_dev' has no member named 'pvReg'; did you mean 'pv_reg'?
sm750_dev->pvReg =
^~~~~
pv_regQuoted 10 lines
Quoted 8 lines
Signed-off-by Emmanuel Arias <[email protected]>--- drivers/staging/sm750fb/sm750.c | 6 +++--- drivers/staging/sm750fb/sm750.h | 4 ++-- drivers/staging/sm750fb/sm750_hw.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-)What changed from v1?
So, in this v2 I added sm750_hw.c.
Please let me know if I misunderstood the workflow
Quoted 4 lines
thanks,
greg k-h
Cheers,
Emmanuel
Greg KH
maintainerQuoted 65 lines · On Tue, May 26, 2026 at 08:30:56PM +0000, [email protected] wrote:
Hi,
thanks for your reply
Quoted 5 lines · Greg KH
Quoted 2 lines · Emmanuel Arias
Replace CamelCase variable name with
snake_case:
- pvReg ->pv_regWhy are you keeping the "
pv_"? What does that mean?Sorry, I'm trying to start contributing in the kernel. I run
scripts/checkpatch.pl --file drivers/staging/sm750fb/*.cAnd the output was:
drivers/staging/sm750fb/sm750.c
-------------------------------
WARNING: static const char * array should probably be static const char
* const
#36: FILE:drivers/staging/sm750fb/sm750.c:36:
+static const char *g_fbmode[] = {NULL, NULL};CHECK: Avoid CamelCase: <pvReg>
#758: FILE:drivers/staging/sm750fb/sm750.c:758:
+crtc->cursor.mmio=sm750_dev->pvReg+CHECK: Avoid CamelCase: <setAllEngOff>
#863: FILE:drivers/staging/sm750fb/sm750.c:863:
+sm750_dev->init_parm.setAllEngOff= 0;total: 0 errors, 1 warnings, 2 checks, 1171 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or
--fix-inplace.So I tried to change pvReg for
pv_regand the same for setAllEngOff.Quoted 6 lines
Quoted 4 lines
- setAllEngOff ->
set_all_eng_offReported-by kernel test robot <[email protected]>The test robot told you to make this change?
As I understand the test robot failed because:
drivers/staging/sm750fb/sm750_hw.c: In function 'hw_sm750_map':Quoted 1 line
Quoted 1 line
drivers/staging/sm750fb/sm750_hw.c:43:13: error: 'structsm750_dev' has no member named 'pvReg'; did you mean 'pv_reg'?sm750_dev->pvReg = ^~~~~ pv_regQuoted 9 lines
Quoted 8 lines
Signed-off-by Emmanuel Arias <[email protected]>--- drivers/staging/sm750fb/sm750.c | 6 +++--- drivers/staging/sm750fb/sm750.h | 4 ++-- drivers/staging/sm750fb/sm750_hw.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-)
Quoted 5 lines
Quoted 1 line
What changed from v1?
So, in this v2 I added
sm750_hw.c.Please let me know if I misunderstood the workflow
The workflow is good, but you changed the name without thinking about why checkpatch was telling you the current name was bad, and so you need to pick a correct name for it instead.
Look on the mailing list archives for the many times people have attempted to do this same thing recently for why this name change is not the correct one.
thanks,
greg k-h