From: Ville Syrjala The xoffset, yoffset and yres members of fb_var_screeninfo are __u32. Make them unsigned in the code as well. Signed-off-by: Ville Syrjala Cc: "Antonino A. Daplas" Cc: Krzysztof Helt Signed-off-by: Andrew Morton --- drivers/video/fbmem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff -puN drivers/video/fbmem.c~fbdev-xoffset-yoffset-and-yres-are-unsigned drivers/video/fbmem.c --- a/drivers/video/fbmem.c~fbdev-xoffset-yoffset-and-yres-are-unsigned +++ a/drivers/video/fbmem.c @@ -848,9 +848,8 @@ int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) { struct fb_fix_screeninfo *fix = &info->fix; - int xoffset = var->xoffset; - int yoffset = var->yoffset; - int err = 0, yres = info->var.yres; + unsigned int yres = info->var.yres; + int err = 0; if (var->yoffset > 0) { if (var->vmode & FB_VMODE_YWRAP) { @@ -866,8 +865,8 @@ fb_pan_display(struct fb_info *info, str (var->xoffset % fix->xpanstep))) err = -EINVAL; - if (err || !info->fbops->fb_pan_display || xoffset < 0 || - yoffset < 0 || var->yoffset + yres > info->var.yres_virtual || + if (err || !info->fbops->fb_pan_display || + var->yoffset + yres > info->var.yres_virtual || var->xoffset + info->var.xres > info->var.xres_virtual) return -EINVAL; _