From 7572a1ea034a8fc45e57de28cc7573264975532a Mon Sep 17 00:00:00 2001 From: Ville Syrjala Date: Wed, 23 Jul 2008 21:31:28 -0700 Subject: fbdev: xoffset, yoffset and yres are unsigned 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 Signed-off-by: Linus Torvalds --- drivers/video/fbmem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/video/fbmem.c') diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 1cd5071e536..6b487801eea 100644 --- a/drivers/video/fbmem.c +++ b/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, struct fb_var_screeninfo *var) (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; -- cgit v1.2.3 From 5bb49fcd501aa9fd3d321a22b7c01d9b0db7ab36 Mon Sep 17 00:00:00 2001 From: Philippe De Muyter Date: Wed, 23 Jul 2008 21:31:50 -0700 Subject: video/fb: cleanup FB_MAJOR usage Currently, linux/major.h defines a GRAPHDEV_MAJOR (29) that nobody uses, and linux/fb.h defines the real FB_MAJOR (also 29), that only fbmem.c needs. Drop GRAPHDEV_MAJOR from major.h, move FB_MAJOR definition from fb.h to major.h, and fix fbmem.c to use major.h's definition. Signed-off-by: Philippe De Muyter Cc: Krzysztof Helt Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/fbmem.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video/fbmem.c') diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 6b487801eea..5d84b343109 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -35,6 +35,7 @@ #include #include #include +#include #include -- cgit v1.2.3 From 37e67b75804b84e092ae9f1d7a19dc3522ef78ab Mon Sep 17 00:00:00 2001 From: Huang Weiyi Date: Sat, 26 Jul 2008 19:37:57 +0800 Subject: drivers/video/fbmem.c: removed duplicated include Removed duplicated include in drivers/video/fbmem.c Signed-off-by: Huang Weiyi Signed-off-by: Linus Torvalds --- drivers/video/fbmem.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/video/fbmem.c') diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 5d84b343109..6b487801eea 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -35,7 +35,6 @@ #include #include #include -#include #include -- cgit v1.2.3