summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorCristian Del Gobbo <cristiandelgobbo87@gmail.com>2025-11-03 00:01:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-09 11:19:02 +0900
commit23413fe138e05eef7f7cc86eaf2acf7ab7d8a628 (patch)
treec585248344903166b86c6f9966edacb8b454e0c3 /drivers/staging
parent3a3fd27e06c38933f248eddf8e2ca328c24f0b07 (diff)
staging: sm750fb: avoid chained assignment in setcolreg()
Replace the chained assignment of red/green/blue with a temporary variable and braces. This keeps behavior identical while improving readability and satisfying checkpatch. No functional change intended. Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com> Link: https://patch.msgid.link/20251102230139.1720-2-cristiandelgobbo87@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/sm750fb/sm750.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9740f2705679..fecd7457e615 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -537,8 +537,13 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
return -EINVAL;
}
- if (info->var.grayscale)
- red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+ if (info->var.grayscale) {
+ int lum = (red * 77 + green * 151 + blue * 28) >> 8;
+
+ red = lum;
+ green = lum;
+ blue = lum;
+ }
if (var->bits_per_pixel == 8 &&
info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {