Commit 8018ce3f authored by Sachin Shukla's avatar Sachin Shukla Committed by Bartlomiej Zolnierkiewicz

video: fbdev: amifb: remove impossible condition

xoffset and yoffset of struct fb_var_screeninfo are unsigned and so
they can never be less than 0.

Cc: Timur Tabi <timur@tabi.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: sachiniiitm@gmail.com
Cc: ravikant.s2@samsung.com
Cc: p.shailesh@samsung.com
Cc: ashish.kalra@samsung.com
Cc: vidushi.koul@samsung.com
Signed-off-by: default avatarSachin Shukla <sachin.s5@samsung.com>
[b.zolnierkie: split from the bigger patch]
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 6e376822
......@@ -1484,13 +1484,11 @@ static int ami_decode_var(struct fb_var_screeninfo *var, struct amifb_par *par,
par->xoffset = var->xoffset;
par->yoffset = var->yoffset;
if (par->vmode & FB_VMODE_YWRAP) {
if (par->xoffset || par->yoffset < 0 ||
par->yoffset >= par->vyres)
if (par->yoffset >= par->vyres)
par->xoffset = par->yoffset = 0;
} else {
if (par->xoffset < 0 ||
par->xoffset > upx(16 << maxfmode, par->vxres - par->xres) ||
par->yoffset < 0 || par->yoffset > par->vyres - par->yres)
if (par->xoffset > upx(16 << maxfmode, par->vxres - par->xres) ||
par->yoffset > par->vyres - par->yres)
par->xoffset = par->yoffset = 0;
}
} else
......
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