Commit 0704916a authored by Sachin Shukla's avatar Sachin Shukla Committed by Bartlomiej Zolnierkiewicz

video: fbdev: fsl-diu-fb: remove impossible condition

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

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>
Acked-by: default avatarTimur Tabi <timur@tabi.org>
[b.zolnierkie: split from the bigger patch]
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 8018ce3f
......@@ -703,12 +703,6 @@ static int fsl_diu_check_var(struct fb_var_screeninfo *var,
if (var->yres_virtual < var->yres)
var->yres_virtual = var->yres;
if (var->xoffset < 0)
var->xoffset = 0;
if (var->yoffset < 0)
var->yoffset = 0;
if (var->xoffset + info->var.xres > info->var.xres_virtual)
var->xoffset = info->var.xres_virtual - info->var.xres;
......@@ -1254,8 +1248,7 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var,
(info->var.yoffset == var->yoffset))
return 0; /* No change, do nothing */
if (var->xoffset < 0 || var->yoffset < 0
|| var->xoffset + info->var.xres > info->var.xres_virtual
if (var->xoffset + info->var.xres > info->var.xres_virtual
|| var->yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL;
......
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