diff options
author | Sachin Shukla <sachin.s5@samsung.com> | 2017-02-08 16:44:00 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-02-08 16:44:00 +0100 |
commit | 8018ce3f20c570e1ae75a42d924ee97db8cad82a (patch) | |
tree | 26684ee261c37906e09db38c7e3db58bc35fc418 /drivers/video | |
parent | 6e376822ee9e06c5fa81424c8cf9218abfabefff (diff) |
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: Sachin Shukla <sachin.s5@samsung.com>
[b.zolnierkie: split from the bigger patch]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/amifb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c index 1d702e13aaff..cc11c6061298 100644 --- a/drivers/video/fbdev/amifb.c +++ b/drivers/video/fbdev/amifb.c @@ -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 |