Commit bc5e36f3 authored by Colin Ian King's avatar Colin Ian King Committed by Bartlomiej Zolnierkiewicz

OMAP: DSS2: remove non-zero check on variable r

Variable r is being initialized to zero, so the check of a non-zero
rv is redundant and can be removed.

It appears that the previous case statements set r to be -EINVAL
and the "Fallthrough" comment afterwards suggested it was going
to fall through to this non-zero check but won't because of the
break statement. Remove the confusion by removing the Fallthrough
comment too.

Addresses-Coverity: ("Logically dead code")
Fixes: b39a982d ("OMAP: DSS2: omapfb driver")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191204152847.1435188-1-colin.king@canonical.com
parent 52733e95
...@@ -1154,16 +1154,12 @@ static int _setcolreg(struct fb_info *fbi, u_int regno, u_int red, u_int green, ...@@ -1154,16 +1154,12 @@ static int _setcolreg(struct fb_info *fbi, u_int regno, u_int red, u_int green,
r = fbdev->ctrl->setcolreg(regno, red, green, blue, r = fbdev->ctrl->setcolreg(regno, red, green, blue,
transp, update_hw_pal); transp, update_hw_pal);
*/ */
/* Fallthrough */
r = -EINVAL; r = -EINVAL;
break; break;
case OMAPFB_COLOR_RGB565: case OMAPFB_COLOR_RGB565:
case OMAPFB_COLOR_RGB444: case OMAPFB_COLOR_RGB444:
case OMAPFB_COLOR_RGB24P: case OMAPFB_COLOR_RGB24P:
case OMAPFB_COLOR_RGB24U: case OMAPFB_COLOR_RGB24U:
if (r != 0)
break;
if (regno < 16) { if (regno < 16) {
u32 pal; u32 pal;
pal = ((red >> (16 - var->red.length)) << pal = ((red >> (16 - var->red.length)) <<
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment