* [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings in sm750.c @ 2025-07-16 0:55 Ignacio Peña 2025-07-16 0:55 ` [PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Ignacio Peña @ 2025-07-16 0:55 UTC (permalink / raw) To: dan.carpenter Cc: gregkh, linux-staging, devel, linux-kernel, Ignacio Peña This patch series addresses the checkpatch.pl warnings identified by Dan Carpenter's review. The changes have been split into three separate patches as requested: 1. Fix const declaration for g_fbmode array 2. Fix function parameter alignment 3. Fix CamelCase variable naming Each patch addresses a specific type of checkpatch warning and can be applied independently. The changes are purely stylistic and do not affect functionality. 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] 5+ messages in thread
* [PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array 2025-07-16 0:55 [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings in sm750.c Ignacio Peña @ 2025-07-16 0:55 ` Ignacio Peña 2025-07-16 4:18 ` Dan Carpenter 2025-07-16 0:55 ` [PATCH 2/3] staging: sm750fb: Fix function parameter alignment Ignacio Peña 2025-07-16 0:55 ` [PATCH 3/3] staging: sm750fb: Fix CamelCase variable naming Ignacio Peña 2 siblings, 1 reply; 5+ messages in thread From: Ignacio Peña @ 2025-07-16 0:55 UTC (permalink / raw) To: dan.carpenter Cc: gregkh, linux-staging, devel, linux-kernel, Ignacio Peña The g_fbmode array should be declared as const pointer to const string as its contents never change. --- 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] 5+ messages in thread
* Re: [PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array 2025-07-16 0:55 ` [PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña @ 2025-07-16 4:18 ` Dan Carpenter 0 siblings, 0 replies; 5+ messages in thread From: Dan Carpenter @ 2025-07-16 4:18 UTC (permalink / raw) To: Ignacio Peña; +Cc: gregkh, linux-staging, devel, linux-kernel On Tue, Jul 15, 2025 at 08:55:51PM -0400, Ignacio Peña wrote: > The g_fbmode array should be declared as const pointer to const > string as its contents never change. Try compiling this code. The contents do change. There are a few other issues as well. Try running checkpatch on your patch. Also there is a specific format for v2 patches https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/ regards, dan carpenter ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] staging: sm750fb: Fix function parameter alignment 2025-07-16 0:55 [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings in sm750.c Ignacio Peña 2025-07-16 0:55 ` [PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña @ 2025-07-16 0:55 ` Ignacio Peña 2025-07-16 0:55 ` [PATCH 3/3] staging: sm750fb: Fix CamelCase variable naming Ignacio Peña 2 siblings, 0 replies; 5+ messages in thread From: Ignacio Peña @ 2025-07-16 0:55 UTC (permalink / raw) To: dan.carpenter Cc: gregkh, linux-staging, devel, linux-kernel, Ignacio Peña Align function parameters properly to fix checkpatch.pl warnings about misaligned function arguments. --- 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] 5+ messages in thread
* [PATCH 3/3] staging: sm750fb: Fix CamelCase variable naming 2025-07-16 0:55 [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings in sm750.c Ignacio Peña 2025-07-16 0:55 ` [PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña 2025-07-16 0:55 ` [PATCH 2/3] staging: sm750fb: Fix function parameter alignment Ignacio Peña @ 2025-07-16 0:55 ` Ignacio Peña 2 siblings, 0 replies; 5+ messages in thread From: Ignacio Peña @ 2025-07-16 0:55 UTC (permalink / raw) To: dan.carpenter Cc: gregkh, linux-staging, devel, 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. --- 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] 5+ messages in thread
end of thread, other threads:[~2025-07-16 4:18 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-07-16 0:55 [PATCH v2 0/3] staging: sm750fb: Fix checkpatch warnings in sm750.c Ignacio Peña 2025-07-16 0:55 ` [PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array Ignacio Peña 2025-07-16 4:18 ` Dan Carpenter 2025-07-16 0:55 ` [PATCH 2/3] staging: sm750fb: Fix function parameter alignment Ignacio Peña 2025-07-16 0:55 ` [PATCH 3/3] staging: sm750fb: Fix CamelCase variable naming Ignacio Peña
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).