Skip to contentSkip to conversation

staging: sm750fb: Remove CamelCase in lynxfb_crtc

PATCH New Benjamin Philip 1 participant 5 messages Jul 27, 2021

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

cover staging: sm750fb: Remove CamelCase in lynxfb_crtc

This patchset (as the subject implies) renames some struct members to follow the snake_case naming convention from CamelCase. By doing so, it also fixes 2 checkpatch CHECKs.

To test it, I have checked if the module builds, which it does. I have also ensured that checkpatch.pl does not issue any new warnings.

Also, is this patchset fine or should I have clubbed it into one big commit, Greg?

Thanks,
Benjamin Philip

Benjamin Philip (4):
staging: sm750fb: Rename oScreen to o_screen in lynxfb_crtc
staging: sm750fb: Rename oCursor to o_cursor in lynxfb_crtc
staging: sm750fb: Rename vCursor to v_cursor in lynxfb_crtc
staging: sm750fb: Rename vScreen to v_screen in lynxfb_crtc

 drivers/staging/sm750fb/sm750.c    | 44 ++++++++++-----------
 drivers/staging/sm750fb/sm750.h    |  8 ++--
 drivers/staging/sm750fb/sm750_hw.c | 62 +++++++++++++++---------------
 3 files changed, 57 insertions(+), 57 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/4 staging: sm750fb: Rename oScreen to o_screen in lynxfb_crtc

The struct lynxfb_crtc has a member named oScreen. This name is CamelCase and is frowned upon. This commit renames it to o_screen and makes the necessary changes for the module to build.

This change also fixes the following checkpatch CHECKs:

CHECK: Avoid CamelCase: <oScreen>
138: FILE: sm750.h:138:
+ int oScreen; /* onscreen address offset in vidmem */

CHECK: Avoid CamelCase: <oScreen>
178: FILE: sm750.c:178:
+ base = par->crtc.oScreen;

---
 drivers/staging/sm750fb/sm750.c    | 30 +++++++--------
 drivers/staging/sm750fb/sm750.h    |  2 +-
 drivers/staging/sm750fb/sm750_hw.c | 62 +++++++++++++++---------------
 3 files changed, 47 insertions(+), 47 deletions(-)
drivers/staging/sm750fb/sm750.c +15 -15
index 4f5f68e6aa60..202d8f47365c 100644
@@ -175,7 +175,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
 	 * each time 2d function begin to work,below three variable always need
 	 * be set, seems we can put them together in some place
 	 */
-	base = par->crtc.oScreen;
+	base = par->crtc.o_screen;
 	pitch = info->fix.line_length;
 	Bpp = info->var.bits_per_pixel >> 3;
 
@@ -213,7 +213,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
 	 * each time 2d function begin to work,below three variable always need
 	 * be set, seems we can put them together in some place
 	 */
-	base = par->crtc.oScreen;
+	base = par->crtc.o_screen;
 	pitch = info->fix.line_length;
 	Bpp = info->var.bits_per_pixel >> 3;
 
@@ -247,7 +247,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 	 * each time 2d function begin to work,below three variable always need
 	 * be set, seems we can put them together in some place
 	 */
-	base = par->crtc.oScreen;
+	base = par->crtc.o_screen;
 	pitch = info->fix.line_length;
 	Bpp = info->var.bits_per_pixel >> 3;
 
@@ -614,44 +614,44 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
 	case sm750_simul_pri:
 		output->paths = sm750_pnc;
 		crtc->channel = sm750_primary;
-		crtc->oScreen = 0;
+		crtc->o_screen = 0;
 		crtc->vScreen = sm750_dev->pvMem;
 		pr_info("use simul primary mode\n");
 		break;
 	case sm750_simul_sec:
 		output->paths = sm750_pnc;
 		crtc->channel = sm750_secondary;
-		crtc->oScreen = 0;
+		crtc->o_screen = 0;
 		crtc->vScreen = sm750_dev->pvMem;
 		break;
 	case sm750_dual_normal:
 		if (par->index == 0) {
 			output->paths = sm750_panel;
 			crtc->channel = sm750_primary;
-			crtc->oScreen = 0;
+			crtc->o_screen = 0;
 			crtc->vScreen = sm750_dev->pvMem;
 		} else {
 			output->paths = sm750_crt;
 			crtc->channel = sm750_secondary;
-			/* not consider of padding stuffs for oScreen,need fix */
-			crtc->oScreen = sm750_dev->vidmem_size >> 1;
-			crtc->vScreen = sm750_dev->pvMem + crtc->oScreen;
+			/* not consider of padding stuffs for o_screen,need fix */
+			crtc->o_screen = sm750_dev->vidmem_size >> 1;
+			crtc->vScreen = sm750_dev->pvMem + crtc->o_screen;
 		}
 		break;
 	case sm750_dual_swap:
 		if (par->index == 0) {
 			output->paths = sm750_panel;
 			crtc->channel = sm750_secondary;
-			crtc->oScreen = 0;
+			crtc->o_screen = 0;
 			crtc->vScreen = sm750_dev->pvMem;
 		} else {
 			output->paths = sm750_crt;
 			crtc->channel = sm750_primary;
-			/* not consider of padding stuffs for oScreen,
+			/* not consider of padding stuffs for o_screen,
 			 * need fix
 			 */
-			crtc->oScreen = sm750_dev->vidmem_size >> 1;
-			crtc->vScreen = sm750_dev->pvMem + crtc->oScreen;
+			crtc->o_screen = sm750_dev->vidmem_size >> 1;
+			crtc->vScreen = sm750_dev->pvMem + crtc->o_screen;
 		}
 		break;
 	default:
@@ -718,7 +718,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 	 * set current cursor variable and proc pointer,
 	 * must be set after crtc member initialized
 	 */
-	crtc->cursor.offset = crtc->oScreen + crtc->vidmem_size - 1024;
+	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
 	crtc->cursor.mmio = sm750_dev->pvReg +
 		0x800f0 + (int)crtc->channel * 0x140;
 
@@ -816,7 +816,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 
 	strscpy(fix->id, fixId[index], sizeof(fix->id));
 
-	fix->smem_start = crtc->oScreen + sm750_dev->vidmem_start;
+	fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
 	pr_info("fix->smem_start = %lx\n", fix->smem_start);
 	/*
 	 * according to mmap experiment from user space application,
drivers/staging/sm750fb/sm750.h +1 -1
index 8271cf7c89f3..08c1048be541 100644
@@ -135,7 +135,7 @@ struct lynxfb_crtc {
 	unsigned char __iomem *vCursor; /* virtual address of cursor */
 	unsigned char __iomem *vScreen; /* virtual address of on_screen */
 	int oCursor; /* cursor address offset in vidmem */
-	int oScreen; /* onscreen address offset in vidmem */
+	int o_screen; /* onscreen address offset in vidmem */
 	int channel;/* which channel this crtc stands for*/
 	resource_size_t vidmem_size;/* this view's video memory max size */
 
drivers/staging/sm750fb/sm750_hw.c +31 -31

160 lines not on this page · raw message

Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/4 staging: sm750fb: Rename oCursor to o_cursor in lynxfb_crtc

In reply to Benjamin Philip

The struct lynxfb_crtc has a member named oCursor. This name is CamelCase and is frowned upon. This commit renames it to o_cursor and makes the necessary changes for the module to build.

This change also fixes the following checkpatch CHECK:

CHECK: Avoid CamelCase: <oCursor>
137: FILE: sm750.h:137:
+ int oCursor; /* cursor address offset in vidmem */

---
 drivers/staging/sm750fb/sm750.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.h +1 -1
index 08c1048be541..4093d5e898c6 100644
@@ -134,7 +134,7 @@ struct lynx_cursor {
 struct lynxfb_crtc {
 	unsigned char __iomem *vCursor; /* virtual address of cursor */
 	unsigned char __iomem *vScreen; /* virtual address of on_screen */
-	int oCursor; /* cursor address offset in vidmem */
+	int o_cursor; /* cursor address offset in vidmem */
 	int o_screen; /* onscreen address offset in vidmem */
 	int channel;/* which channel this crtc stands for*/
 	resource_size_t vidmem_size;/* this view's video memory max size */
Signature · 1 line
2.31.1
#3 lore raw

PATCH 3/4 staging: sm750fb: Rename vCursor to v_cursor in lynxfb_crtc

In reply to Benjamin Philip

The struct lynxfb_crtc has a member named vCursor. This name is CamelCase and is frowned upon. This commit renames it to v_cursor and makes the necessary changes for the module to build.

This change also fixes the following checkpatch CHECK:

CHECK: Avoid CamelCase: <vCursor>
135: FILE: sm750.h:135:
+ unsigned char __iomem *vCursor; /* virtual address of cursor */

---
 drivers/staging/sm750fb/sm750.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.h +1 -1
index 4093d5e898c6..8952154739ac 100644
@@ -132,7 +132,7 @@ struct lynx_cursor {
 };
 
 struct lynxfb_crtc {
-	unsigned char __iomem *vCursor; /* virtual address of cursor */
+	unsigned char __iomem *v_cursor; /* virtual address of cursor */
 	unsigned char __iomem *vScreen; /* virtual address of on_screen */
 	int o_cursor; /* cursor address offset in vidmem */
 	int o_screen; /* onscreen address offset in vidmem */
Signature · 1 line
2.31.1
#4 lore raw

PATCH 4/4 staging: sm750fb: Rename vScreen to v_screen in lynxfb_crtc

In reply to Benjamin Philip

The struct lynxfb_crtc has a member named vScreen. This name is CamelCase and is frowned upon. This commit renames it to v_screen and makes the necessary changes for the module to build.

This change also fixes the following checkpatch CHECKs:

CHECK: Avoid CamelCase: <vScreen>
454: FILE: sm750.c:454:
+ memset_io(crtc->vScreen, 0x0, crtc->vidmem_size);

CHECK: Avoid CamelCase: <vScreen>
136: FILE: sm750.h:136:
+ unsigned char __iomem *vScreen; /* virtual address of on_screen */

---
 drivers/staging/sm750fb/sm750.c | 18 +++++++++---------
 drivers/staging/sm750fb/sm750.h |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/staging/sm750fb/sm750.c +9 -9
index 202d8f47365c..dbd1159a2ef0 100644
@@ -451,7 +451,7 @@ static int __maybe_unused lynxfb_resume(struct device *dev)
 		crtc = &par->crtc;
 		cursor = &crtc->cursor;
 		memset_io(cursor->vstart, 0x0, cursor->size);
-		memset_io(crtc->vScreen, 0x0, crtc->vidmem_size);
+		memset_io(crtc->v_screen, 0x0, crtc->vidmem_size);
 		lynxfb_ops_set_par(info);
 		fb_set_suspend(info, 0);
 	}
@@ -463,7 +463,7 @@ static int __maybe_unused lynxfb_resume(struct device *dev)
 		crtc = &par->crtc;
 		cursor = &crtc->cursor;
 		memset_io(cursor->vstart, 0x0, cursor->size);
-		memset_io(crtc->vScreen, 0x0, crtc->vidmem_size);
+		memset_io(crtc->v_screen, 0x0, crtc->vidmem_size);
 		lynxfb_ops_set_par(info);
 		fb_set_suspend(info, 0);
 	}
@@ -615,27 +615,27 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
 		output->paths = sm750_pnc;
 		crtc->channel = sm750_primary;
 		crtc->o_screen = 0;
-		crtc->vScreen = sm750_dev->pvMem;
+		crtc->v_screen = sm750_dev->pvMem;
 		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->vScreen = sm750_dev->pvMem;
+		crtc->v_screen = sm750_dev->pvMem;
 		break;
 	case sm750_dual_normal:
 		if (par->index == 0) {
 			output->paths = sm750_panel;
 			crtc->channel = sm750_primary;
 			crtc->o_screen = 0;
-			crtc->vScreen = sm750_dev->pvMem;
+			crtc->v_screen = sm750_dev->pvMem;
 		} 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->vScreen = sm750_dev->pvMem + crtc->o_screen;
+			crtc->v_screen = sm750_dev->pvMem + crtc->o_screen;
 		}
 		break;
 	case sm750_dual_swap:
@@ -643,7 +643,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
 			output->paths = sm750_panel;
 			crtc->channel = sm750_secondary;
 			crtc->o_screen = 0;
-			crtc->vScreen = sm750_dev->pvMem;
+			crtc->v_screen = sm750_dev->pvMem;
 		} else {
 			output->paths = sm750_crt;
 			crtc->channel = sm750_primary;
@@ -651,7 +651,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
 			 * need fix
 			 */
 			crtc->o_screen = sm750_dev->vidmem_size >> 1;
-			crtc->vScreen = sm750_dev->pvMem + crtc->o_screen;
+			crtc->v_screen = sm750_dev->pvMem + crtc->o_screen;
 		}
 		break;
 	default:
@@ -801,7 +801,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 			    crtc->line_pad);
 
 	info->pseudo_palette = &par->pseudo_palette[0];
-	info->screen_base = crtc->vScreen;
+	info->screen_base = crtc->v_screen;
 	pr_debug("screen_base vaddr = %p\n", info->screen_base);
 	info->screen_size = line_length * var->yres_virtual;
 	info->flags = FBINFO_FLAG_DEFAULT | 0;
drivers/staging/sm750fb/sm750.h +1 -1
index 8952154739ac..aff69661c8e6 100644
@@ -133,7 +133,7 @@ struct lynx_cursor {
 
 struct lynxfb_crtc {
 	unsigned char __iomem *v_cursor; /* virtual address of cursor */
-	unsigned char __iomem *vScreen; /* virtual address of on_screen */
+	unsigned char __iomem *v_screen; /* virtual address of on_screen */
 	int o_cursor; /* cursor address offset in vidmem */
 	int o_screen; /* onscreen address offset in vidmem */
 	int channel;/* which channel this crtc stands for*/
Signature · 1 line
2.31.1