diff mbox

video: fbdev: intelfb: remove impossible condition

Message ID 1472658269-1234-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sudip Mukherjee Aug. 31, 2016, 3:44 p.m. UTC
xoffset and yoffset of struct fb_var_screeninfo are unsigned and so
they can never be less than 0.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---
 drivers/video/fbdev/intelfb/intelfbdrv.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Tomi Valkeinen Sept. 7, 2016, 8:16 a.m. UTC | #1
On 31/08/16 18:44, Sudip Mukherjee wrote:
> xoffset and yoffset of struct fb_var_screeninfo are unsigned and so
> they can never be less than 0.
> 
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> ---
>  drivers/video/fbdev/intelfb/intelfbdrv.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/video/fbdev/intelfb/intelfbdrv.c b/drivers/video/fbdev/intelfb/intelfbdrv.c
> index bf20744..ff2a5d2 100644
> --- a/drivers/video/fbdev/intelfb/intelfbdrv.c
> +++ b/drivers/video/fbdev/intelfb/intelfbdrv.c
> @@ -1301,11 +1301,6 @@ static int intelfb_check_var(struct fb_var_screeninfo *var,
>  		break;
>  	}
>  
> -	if (v.xoffset < 0)
> -		v.xoffset = 0;
> -	if (v.yoffset < 0)
> -		v.yoffset = 0;
> -
>  	if (v.xoffset > v.xres_virtual - v.xres)
>  		v.xoffset = v.xres_virtual - v.xres;
>  	if (v.yoffset > v.yres_virtual - v.yres)
> 

Thanks, queued for 4.9.

 Tomi
diff mbox

Patch

diff --git a/drivers/video/fbdev/intelfb/intelfbdrv.c b/drivers/video/fbdev/intelfb/intelfbdrv.c
index bf20744..ff2a5d2 100644
--- a/drivers/video/fbdev/intelfb/intelfbdrv.c
+++ b/drivers/video/fbdev/intelfb/intelfbdrv.c
@@ -1301,11 +1301,6 @@  static int intelfb_check_var(struct fb_var_screeninfo *var,
 		break;
 	}
 
-	if (v.xoffset < 0)
-		v.xoffset = 0;
-	if (v.yoffset < 0)
-		v.yoffset = 0;
-
 	if (v.xoffset > v.xres_virtual - v.xres)
 		v.xoffset = v.xres_virtual - v.xres;
 	if (v.yoffset > v.yres_virtual - v.yres)