All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings
@ 2025-07-16  3:38 Ignacio Peña
  2025-07-16  3:38 ` [PATCH v2 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ignacio Peña @ 2025-07-16  3:38 UTC (permalink / raw)
  To: Dan Carpenter, Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel

Changes in v2:
 - Split single patch into 3 separate patches as requested by Dan Carpenter
 - Each patch now addresses a single type of warning
 - Ensured patches compile independently

This patch series fixes checkpatch warnings in sm750fb driver.

The patches address:
1. const declaration for g_fbmode array
2. function parameter alignment
3. CamelCase variable naming

Ignacio Peña (3):
  staging: sm750fb: Fix const declaration for g_fbmode array
  staging: sm750fb: Fix function parameter alignment  
  staging: sm750fb: Fix CamelCase variable naming

 drivers/staging/sm750fb/sm750.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

-- 
2.39.5 (Apple Git-154)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/3] staging: sm750fb: Fix const declaration for g_fbmode array
  2025-07-16  3:38 [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings Ignacio Peña
@ 2025-07-16  3:38 ` Ignacio Peña
  2025-07-16  3:38 ` [PATCH v2 2/3] staging: sm750fb: Fix function parameter alignment Ignacio Peña
  2025-07-16  3:38 ` [PATCH v2 3/3] staging: sm750fb: Fix CamelCase variable naming Ignacio Peña
  2 siblings, 0 replies; 4+ messages in thread
From: Ignacio Peña @ 2025-07-16  3:38 UTC (permalink / raw)
  To: Dan Carpenter, Greg Kroah-Hartman
  Cc: linux-staging, linux-kernel, Ignacio Peña

The g_fbmode array should be declared as const pointer to const
string as its contents never change.

Signed-off-by: Ignacio Peña <ignacio.pena87@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 1d929aca3..d3bce107f 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char *const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview;
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/3] staging: sm750fb: Fix function parameter alignment
  2025-07-16  3:38 [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings Ignacio Peña
  2025-07-16  3:38 ` [PATCH v2 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña
@ 2025-07-16  3:38 ` Ignacio Peña
  2025-07-16  3:38 ` [PATCH v2 3/3] staging: sm750fb: Fix CamelCase variable naming Ignacio Peña
  2 siblings, 0 replies; 4+ messages in thread
From: Ignacio Peña @ 2025-07-16  3:38 UTC (permalink / raw)
  To: Dan Carpenter, Greg Kroah-Hartman
  Cc: linux-staging, linux-kernel, Ignacio Peña

Align function parameters properly to fix checkpatch.pl warnings about
misaligned function arguments.

Signed-off-by: Ignacio Peña <ignacio.pena87@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index d3bce107f..a896227ef 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -121,13 +121,13 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
 	sm750_hw_cursor_disable(cursor);
 	if (fbcursor->set & FB_CUR_SETSIZE)
 		sm750_hw_cursor_set_size(cursor,
-					fbcursor->image.width,
-					fbcursor->image.height);
+					 fbcursor->image.width,
+					 fbcursor->image.height);
 
 	if (fbcursor->set & FB_CUR_SETPOS)
 		sm750_hw_cursor_set_pos(cursor,
-				       fbcursor->image.dx - info->var.xoffset,
-				       fbcursor->image.dy - info->var.yoffset);
+					fbcursor->image.dx - info->var.xoffset,
+					fbcursor->image.dy - info->var.yoffset);
 
 	if (fbcursor->set & FB_CUR_SETCMAP) {
 		/* get the 16bit color of kernel means */
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 3/3] staging: sm750fb: Fix CamelCase variable naming
  2025-07-16  3:38 [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings Ignacio Peña
  2025-07-16  3:38 ` [PATCH v2 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña
  2025-07-16  3:38 ` [PATCH v2 2/3] staging: sm750fb: Fix function parameter alignment Ignacio Peña
@ 2025-07-16  3:38 ` Ignacio Peña
  2 siblings, 0 replies; 4+ messages in thread
From: Ignacio Peña @ 2025-07-16  3:38 UTC (permalink / raw)
  To: Dan Carpenter, Greg Kroah-Hartman
  Cc: linux-staging, linux-kernel, Ignacio Peña

Rename variable 'Bpp' to 'bpp' to fix checkpatch.pl warnings about
CamelCase variable names. Use lowercase naming convention for
local variables.

Signed-off-by: Ignacio Peña <ignacio.pena87@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index a896227ef..f36ad8324 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -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);
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-16  3:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  3:38 [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings Ignacio Peña
2025-07-16  3:38 ` [PATCH v2 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña
2025-07-16  3:38 ` [PATCH v2 2/3] staging: sm750fb: Fix function parameter alignment Ignacio Peña
2025-07-16  3:38 ` [PATCH v2 3/3] staging: sm750fb: Fix CamelCase variable naming Ignacio Peña

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.