Skip to contentSkip to conversation

staging: sm750fb: style fixes: align call and split chained assignment

PATCH In review Cristian Del Gobbo 2 participants 2 messages Oct 29, 2025

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

PATCH v2 1/1 staging: sm750fb: style fixes: align call and split chained assignment

- 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.

---
 drivers/staging/sm750fb/sm750.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/staging/sm750fb/sm750.c +7 -3
index 3659af7e519d..94a99af4320e 100644
@@ -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) {
Signature · 1 line
2.34.1
#1 lore raw

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.

Quoted 1 line · Cristian Del Gobbo

- 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/

Quoted 4 lines

- 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.

Quoted 6 lines

No functional change intended.

Also run your patch through checkpatch.pl.

Quoted 20 lines
---
 drivers/staging/sm750fb/sm750.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/staging/sm750fb/sm750.c +2 -2
index 3659af7e519d..94a99af4320e 100644
@@ -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,

drivers/staging/sm750fb/sm750.c static int lynxfb_ops_setcolreg(unsigned int regno, · line 541

Quoted 5 lines
drivers/staging/sm750fb/sm750.c +1 -1
@@ -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