Skip to contentSkip to conversation

staging: sm750fb: fix 2 CamelCase variables

PATCH In review Jennifer Guo 2 participants 6 messages May 11 – May 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover staging: sm750fb: fix 2 CamelCase variables

This patchset renames 2 more CamelCase variables in the sm750fb driver.
- pvReg -> vreg
- setAllEngOff -> set_all_eng_off

No functional changes.

Jennifer Guo (2):
staging: sm750fb: rename CamelCase variable pvReg and drop prefix
staging: sm750fb: rename CamelCase variable setAllEngOff

 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(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 staging: sm750fb: rename CamelCase variable pvReg and drop prefix

Renames the CamelCase variable 'pvReg' in struct sm750_dev to 'vreg'. Dropping the pointer prefix 'p'.

This fixes the following checkpatch.pl check:
CHECK: Avoid CamelCase: <pvReg>

---
 drivers/staging/sm750fb/sm750.c    |  4 ++--
 drivers/staging/sm750fb/sm750.h    |  2 +-
 drivers/staging/sm750fb/sm750_hw.c | 12 ++++++------
 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/sm750fb/sm750.c +2 -2
index 996a586a3727..d2fe789efe31 100644
@@ -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->vreg +
 		0x800f0 + (int)crtc->channel * 0x140;
 
 	crtc->cursor.max_h = 64;
@@ -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->vreg);
 	iounmap(sm750_dev->vmem);
 	pci_release_region(pdev, 1);
 	kfree(g_settings);
drivers/staging/sm750fb/sm750.h +1 -1
index d2c522e67f26..a40dbcc2e6c8 100644
@@ -97,7 +97,7 @@ struct sm750_dev {
 	unsigned long vidreg_start;
 	__u32 vidmem_size;
 	__u32 vidreg_size;
-	void __iomem *pvReg;
+	void __iomem *vreg;
 	unsigned char __iomem *vmem;
 	/* locks*/
 	spinlock_t slock;
drivers/staging/sm750fb/sm750_hw.c +6 -6
index 6f7c354a34a1..98983b1192f2 100644
@@ -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->vreg =
 		ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
-	if (!sm750_dev->pvReg) {
+	if (!sm750_dev->vreg) {
 		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->vreg + DE_BASE_ADDR_TYPE1;
+	sm750_dev->accel.dp_port_base = sm750_dev->vreg + DE_PORT_ADDR_TYPE1;
 
-	mmio750 = sm750_dev->pvReg;
+	mmio750 = sm750_dev->vreg;
 	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->vreg);
 err_release_region:
 	pci_release_region(pdev, 1);
 	return ret;
Signature · 1 line
2.34.1
maintainer
#2 lore raw

Re: [PATCH 1/2] staging: sm750fb: rename CamelCase variable pvReg and drop prefix

Quoted 2 lines · Jennifer Guo

Renames the CamelCase variable 'pvReg' in struct sm750_dev to 'vreg'. Dropping the pointer prefix 'p'.

Why are you keeping the prefix "v"?

Please don't keep the "hungarian" notation at all.

thanks,

greg k-h

#3 lore raw

Re: [PATCH 1/2] staging: sm750fb: rename CamelCase variable pvReg and drop prefix

Quoted 8 lines · Greg KH
Quoted 2 lines · Jennifer Guo

Renames the CamelCase variable 'pvReg' in struct sm750_dev to 'vreg'. Dropping the pointer prefix 'p'.

Why are you keeping the prefix "v"?

Please don't keep the "hungarian" notation at all.

Thanks for the feedback!

Based on reading the surrounding code in the header - specifically vidmem_size and vidreg_size - I assumed the 'v' stood for video (and not void) and should thus be kept.

One related note, I have another committed patch: f50b4602fea6 (staging: sm750fb: rename CamelCase variable and drop prefix) where I renamed 'pvMem' to 'vmem', so depending on what the conclusion here is, should I then also update 'vmem' ?

Best,
Jennifer

P.S: First reply here, hope I got the email formatting correct...

maintainer
#4 lore raw

Re: [PATCH 1/2] staging: sm750fb: rename CamelCase variable pvReg and drop prefix

Quoted 12 lines · Jinyuan Guo
Quoted 8 lines · Greg KH
Quoted 2 lines · Jennifer Guo

Renames the CamelCase variable 'pvReg' in struct sm750_dev to 'vreg'. Dropping the pointer prefix 'p'.

Why are you keeping the prefix "v"?

Please don't keep the "hungarian" notation at all.

Thanks for the feedback!

Quoted 8 lines

Based on reading the surrounding code in the header - specifically vidmem_size and vidreg_size - I assumed the 'v' stood for video (and not void) and should thus be kept.

One related note, I have another committed patch: f50b4602fea6 (staging: sm750fb: rename CamelCase variable and drop prefix) where I renamed 'pvMem' to 'vmem', so depending on what the conclusion here is, should I then also update 'vmem' ?

You probably should fix that up too, sorry for missing that.

thanks,

greg k-h

#5 lore raw

PATCH 2/2 staging: sm750fb: rename CamelCase variable setAllEngOff

In reply to Jennifer Guo

Renames the CamelCase variable 'setAllEngOff' inside struct init_status to adhere to kernel coding style:
- setAllEngOff -> set_all_eng_off

This fixes the following checkpatch.pl check:
CHECK: Avoid CamelCase: <setAllEngOff>

---
 drivers/staging/sm750fb/sm750.c | 2 +-
 drivers/staging/sm750fb/sm750.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/sm750fb/sm750.c +1 -1
index d2fe789efe31..659223dfb930 100644
@@ -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 */
drivers/staging/sm750fb/sm750.h +1 -1
index a40dbcc2e6c8..9d5d5466a8d2 100644
@@ -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;
 };
 
Signature · 1 line
2.34.1