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>
pull/1354/merge
Cristian Del Gobbo 2025-11-03 00:01:39 +01:00 committed by Greg Kroah-Hartman
parent 3a3fd27e06
commit 23413fe138
1 changed files with 7 additions and 2 deletions

View File

@ -537,8 +537,13 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
return -EINVAL; return -EINVAL;
} }
if (info->var.grayscale) if (info->var.grayscale) {
red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8; int lum = (red * 77 + green * 151 + blue * 28) >> 8;
red = lum;
green = lum;
blue = lum;
}
if (var->bits_per_pixel == 8 && if (var->bits_per_pixel == 8 &&
info->fix.visual == FB_VISUAL_PSEUDOCOLOR) { info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {