diff options
author | Sachin Shukla <sachin.s5@samsung.com> | 2017-02-08 18:44:00 +0300 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-02-08 18:44:00 +0300 |
commit | 0704916a4b24b0f5db9e3e8a39e906247a50e30f (patch) | |
tree | e5b999550ce3560470e3f191a6481ca421c1d26e /drivers/video | |
parent | 8018ce3f20c570e1ae75a42d924ee97db8cad82a (diff) | |
download | linux-0704916a4b24b0f5db9e3e8a39e906247a50e30f.tar.xz |
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: Sachin Shukla <sachin.s5@samsung.com>
Acked-by: Timur Tabi <timur@tabi.org>
[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/fsl-diu-fb.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c index fe00a07c122e..c48a59e35fae 100644 --- a/drivers/video/fbdev/fsl-diu-fb.c +++ b/drivers/video/fbdev/fsl-diu-fb.c @@ -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; |