* [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
@ 2025-10-29 2:14 Cristian Del Gobbo
2025-10-29 10:16 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Cristian Del Gobbo @ 2025-10-29 2:14 UTC (permalink / raw)
To: sudip.mukherjee
Cc: teddy.wang, gregkh, linux-fbdev, linux-staging, linux-kernel,
Cristian Del Gobbo, Dan Carpenter
- Drop previous change that made g_fbmode[] elements const (broke build).
- Align the continued arguments of sm750_hw_cursor_set_size() with the
opening parenthesis.
- Replace a chained assignment of red/green/blue with a temporary
variable to satisfy checkpatch and improve readability.
No functional change intended.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 3659af7e519d..94a99af4320e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -121,8 +121,8 @@ 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,
@@ -538,7 +538,11 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
}
if (info->var.grayscale)
- red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+ int y = (red * 77 + green * 151 + blue * 28) >> 8;
+
+ red = y;
+ green = y;
+ blue = y;
if (var->bits_per_pixel == 8 &&
info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
@ 2025-10-29 2:17 Cristian Del Gobbo
0 siblings, 0 replies; 8+ messages in thread
From: Cristian Del Gobbo @ 2025-10-29 2:17 UTC (permalink / raw)
To: sudip.mukherjee
Cc: teddy.wang, gregkh, linux-fbdev, linux-staging, linux-kernel,
Cristian Del Gobbo, Dan Carpenter
- Drop previous change that made g_fbmode[] elements const (broke build).
- Align the continued arguments of sm750_hw_cursor_set_size() with the
opening parenthesis.
- Replace a chained assignment of red/green/blue with a temporary
variable to satisfy checkpatch and improve readability.
No functional change intended.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 3659af7e519d..94a99af4320e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -121,8 +121,8 @@ 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,
@@ -538,7 +538,11 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
}
if (info->var.grayscale)
- red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+ int y = (red * 77 + green * 151 + blue * 28) >> 8;
+
+ red = y;
+ green = y;
+ blue = y;
if (var->bits_per_pixel == 8 &&
info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
@ 2025-10-29 2:20 Cristian Del Gobbo
2025-10-29 12:49 ` kernel test robot
2025-10-29 15:46 ` kernel test robot
0 siblings, 2 replies; 8+ messages in thread
From: Cristian Del Gobbo @ 2025-10-29 2:20 UTC (permalink / raw)
To: sudip.mukherjee
Cc: teddy.wang, gregkh, linux-fbdev, linux-staging, linux-kernel,
Cristian Del Gobbo, Dan Carpenter
- Drop previous change that made g_fbmode[] elements const (broke build).
- Align the continued arguments of sm750_hw_cursor_set_size() with the
opening parenthesis.
- Replace a chained assignment of red/green/blue with a temporary
variable to satisfy checkpatch and improve readability.
No functional change intended.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 3659af7e519d..94a99af4320e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -121,8 +121,8 @@ 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,
@@ -538,7 +538,11 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
}
if (info->var.grayscale)
- red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+ int y = (red * 77 + green * 151 + blue * 28) >> 8;
+
+ red = y;
+ green = y;
+ blue = y;
if (var->bits_per_pixel == 8 &&
info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
@ 2025-10-29 2:21 Cristian Del Gobbo
2025-10-29 5:29 ` Dan Carpenter
0 siblings, 1 reply; 8+ messages in thread
From: Cristian Del Gobbo @ 2025-10-29 2:21 UTC (permalink / raw)
To: sudip.mukherjee
Cc: teddy.wang, gregkh, linux-fbdev, linux-staging, linux-kernel,
Cristian Del Gobbo, Dan Carpenter
- Drop previous change that made g_fbmode[] elements const (broke build).
- Align the continued arguments of sm750_hw_cursor_set_size() with the
opening parenthesis.
- Replace a chained assignment of red/green/blue with a temporary
variable to satisfy checkpatch and improve readability.
No functional change intended.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 3659af7e519d..94a99af4320e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -121,8 +121,8 @@ 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,
@@ -538,7 +538,11 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
}
if (info->var.grayscale)
- red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+ int y = (red * 77 + green * 151 + blue * 28) >> 8;
+
+ red = y;
+ green = y;
+ blue = y;
if (var->bits_per_pixel == 8 &&
info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
2025-10-29 2:21 [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment Cristian Del Gobbo
@ 2025-10-29 5:29 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2025-10-29 5:29 UTC (permalink / raw)
To: Cristian Del Gobbo
Cc: sudip.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel
This patch was really confusing because I had no idea what I reported.
Just remove my reported by tag...
This is not a v2 patch, it's a whole new patch. Don't call it a v2.
On Wed, Oct 29, 2025 at 03:21:23AM +0100, Cristian Del Gobbo wrote:
> - Drop previous change that made g_fbmode[] elements const (broke build).
But if it were a v2, this isn't the right way to send a v2. In a v2 this
would go under the --- cut off line.
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
> - Align the continued arguments of sm750_hw_cursor_set_size() with the
> opening parenthesis.
> - Replace a chained assignment of red/green/blue with a temporary
> variable to satisfy checkpatch and improve readability.
These are unrelated changes. Do them as separate patches.
>
> No functional change intended.
>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
>
> Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
Also run your patch through checkpatch.pl.
> ---
> drivers/staging/sm750fb/sm750.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 3659af7e519d..94a99af4320e 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -121,8 +121,8 @@ 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,
> @@ -538,7 +538,11 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
> }
>
> if (info->var.grayscale)
> - red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
> + int y = (red * 77 + green * 151 + blue * 28) >> 8;
y is a strange variable name. It has nothing to do with the y axis.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
2025-10-29 2:14 Cristian Del Gobbo
@ 2025-10-29 10:16 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2025-10-29 10:16 UTC (permalink / raw)
To: Cristian Del Gobbo
Cc: sudip.mukherjee, teddy.wang, linux-fbdev, linux-staging,
linux-kernel, Dan Carpenter
On Wed, Oct 29, 2025 at 03:14:49AM +0100, Cristian Del Gobbo wrote:
> - Drop previous change that made g_fbmode[] elements const (broke build).
> - Align the continued arguments of sm750_hw_cursor_set_size() with the
> opening parenthesis.
> - Replace a chained assignment of red/green/blue with a temporary
> variable to satisfy checkpatch and improve readability.
>
> No functional change intended.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
On top of what Dan said, I see 4 different copies of this patch in my
inbox, which one is the correct one? Please make it easy for
maintainers to know what patch to review, we get 1000+ emails a day to
deal with and have no short term memory :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
2025-10-29 2:20 Cristian Del Gobbo
@ 2025-10-29 12:49 ` kernel test robot
2025-10-29 15:46 ` kernel test robot
1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-10-29 12:49 UTC (permalink / raw)
To: Cristian Del Gobbo, sudip.mukherjee
Cc: llvm, oe-kbuild-all, teddy.wang, gregkh, linux-fbdev,
linux-staging, linux-kernel, Cristian Del Gobbo, Dan Carpenter
Hi Cristian,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Cristian-Del-Gobbo/staging-sm750fb-style-fixes-align-call-and-split-chained-assignment/20251029-102311
base: staging/staging-testing
patch link: https://lore.kernel.org/r/20251029022002.5812-1-cristiandelgobbo87%40gmail.com
patch subject: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
config: powerpc64-randconfig-002-20251029 (https://download.01.org/0day-ci/archive/20251029/202510292010.GP8WnOne-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d1c086e82af239b245fe8d7832f2753436634990)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251029/202510292010.GP8WnOne-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510292010.GP8WnOne-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/staging/sm750fb/sm750.c:541:3: error: expected expression
541 | int y = (red * 77 + green * 151 + blue * 28) >> 8;
| ^
drivers/staging/sm750fb/sm750.c:543:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
543 | red = y;
| ^
drivers/staging/sm750fb/sm750.c:540:2: note: previous statement is here
540 | if (info->var.grayscale)
| ^
>> drivers/staging/sm750fb/sm750.c:543:9: error: use of undeclared identifier 'y'
543 | red = y;
| ^
drivers/staging/sm750fb/sm750.c:544:11: error: use of undeclared identifier 'y'
544 | green = y;
| ^
drivers/staging/sm750fb/sm750.c:545:10: error: use of undeclared identifier 'y'
545 | blue = y;
| ^
1 warning and 4 errors generated.
vim +/y +543 drivers/staging/sm750fb/sm750.c
517
518 static int lynxfb_ops_setcolreg(unsigned int regno,
519 unsigned int red,
520 unsigned int green,
521 unsigned int blue,
522 unsigned int transp,
523 struct fb_info *info)
524 {
525 struct lynxfb_par *par;
526 struct lynxfb_crtc *crtc;
527 struct fb_var_screeninfo *var;
528 int ret;
529
530 par = info->par;
531 crtc = &par->crtc;
532 var = &info->var;
533 ret = 0;
534
535 if (regno > 256) {
536 pr_err("regno = %d\n", regno);
537 return -EINVAL;
538 }
539
540 if (info->var.grayscale)
541 int y = (red * 77 + green * 151 + blue * 28) >> 8;
542
> 543 red = y;
544 green = y;
545 blue = y;
546
547 if (var->bits_per_pixel == 8 &&
548 info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
549 red >>= 8;
550 green >>= 8;
551 blue >>= 8;
552 ret = hw_sm750_set_col_reg(crtc, regno, red, green, blue);
553 goto exit;
554 }
555
556 if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 256) {
557 u32 val;
558
559 if (var->bits_per_pixel == 16 ||
560 var->bits_per_pixel == 32 ||
561 var->bits_per_pixel == 24) {
562 val = chan_to_field(red, &var->red);
563 val |= chan_to_field(green, &var->green);
564 val |= chan_to_field(blue, &var->blue);
565 par->pseudo_palette[regno] = val;
566 goto exit;
567 }
568 }
569
570 ret = -EINVAL;
571
572 exit:
573 return ret;
574 }
575
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
2025-10-29 2:20 Cristian Del Gobbo
2025-10-29 12:49 ` kernel test robot
@ 2025-10-29 15:46 ` kernel test robot
1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-10-29 15:46 UTC (permalink / raw)
To: Cristian Del Gobbo, sudip.mukherjee
Cc: oe-kbuild-all, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel, Cristian Del Gobbo, Dan Carpenter
Hi Cristian,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Cristian-Del-Gobbo/staging-sm750fb-style-fixes-align-call-and-split-chained-assignment/20251029-102311
base: staging/staging-testing
patch link: https://lore.kernel.org/r/20251029022002.5812-1-cristiandelgobbo87%40gmail.com
patch subject: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
config: sparc-randconfig-001-20251029 (https://download.01.org/0day-ci/archive/20251029/202510292220.5YKTkjfH-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251029/202510292220.5YKTkjfH-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510292220.5YKTkjfH-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/staging/sm750fb/sm750.c: In function 'lynxfb_ops_setcolreg':
drivers/staging/sm750fb/sm750.c:541:3: error: expected expression before 'int'
int y = (red * 77 + green * 151 + blue * 28) >> 8;
^~~
drivers/staging/sm750fb/sm750.c:540:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (info->var.grayscale)
^~
drivers/staging/sm750fb/sm750.c:543:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
red = y;
^~~
>> drivers/staging/sm750fb/sm750.c:543:9: error: 'y' undeclared (first use in this function)
red = y;
^
drivers/staging/sm750fb/sm750.c:543:9: note: each undeclared identifier is reported only once for each function it appears in
vim +/y +543 drivers/staging/sm750fb/sm750.c
517
518 static int lynxfb_ops_setcolreg(unsigned int regno,
519 unsigned int red,
520 unsigned int green,
521 unsigned int blue,
522 unsigned int transp,
523 struct fb_info *info)
524 {
525 struct lynxfb_par *par;
526 struct lynxfb_crtc *crtc;
527 struct fb_var_screeninfo *var;
528 int ret;
529
530 par = info->par;
531 crtc = &par->crtc;
532 var = &info->var;
533 ret = 0;
534
535 if (regno > 256) {
536 pr_err("regno = %d\n", regno);
537 return -EINVAL;
538 }
539
540 if (info->var.grayscale)
541 int y = (red * 77 + green * 151 + blue * 28) >> 8;
542
> 543 red = y;
544 green = y;
545 blue = y;
546
547 if (var->bits_per_pixel == 8 &&
548 info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
549 red >>= 8;
550 green >>= 8;
551 blue >>= 8;
552 ret = hw_sm750_set_col_reg(crtc, regno, red, green, blue);
553 goto exit;
554 }
555
556 if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 256) {
557 u32 val;
558
559 if (var->bits_per_pixel == 16 ||
560 var->bits_per_pixel == 32 ||
561 var->bits_per_pixel == 24) {
562 val = chan_to_field(red, &var->red);
563 val |= chan_to_field(green, &var->green);
564 val |= chan_to_field(blue, &var->blue);
565 par->pseudo_palette[regno] = val;
566 goto exit;
567 }
568 }
569
570 ret = -EINVAL;
571
572 exit:
573 return ret;
574 }
575
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-10-29 15:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 2:21 [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment Cristian Del Gobbo
2025-10-29 5:29 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2025-10-29 2:20 Cristian Del Gobbo
2025-10-29 12:49 ` kernel test robot
2025-10-29 15:46 ` kernel test robot
2025-10-29 2:17 Cristian Del Gobbo
2025-10-29 2:14 Cristian Del Gobbo
2025-10-29 10:16 ` Greg KH
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).