From 0704916a4b24b0f5db9e3e8a39e906247a50e30f Mon Sep 17 00:00:00 2001 From: Sachin Shukla Date: Wed, 8 Feb 2017 16:44:00 +0100 Subject: [PATCH] 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 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 Acked-by: Timur Tabi [b.zolnierkie: split from the bigger patch] Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/fsl-diu-fb.c | 9 +-------- 1 file changed, 1 insertion(+), 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; -- 2.20.1