fbdev: correct tests on unsigned
PATCH 1/1 fbdev: correct tests on unsigned
image->dx, ->dy and con2fb.framebuffer are unsigned, so the tests for negatives are wrong or redundant. correct them.
Signed-off-by Roel Kluin <[email protected]>
---
drivers/video/fbmem.c +7 -3
@@ -393,8 +393,10 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, image->dx += image->width +8 ; } }else if (rotate ==FB_ROTATE_UD ) { -for (x =0 ; x < num && image->dx >=0 ; x++) { +for (x =0 ; x < num; x++) { info->fbops->fb_imageblit (info, image); +if (image->dx < image->width +8 ) +break ; image->dx -= image->width +8 ; } }else if (rotate ==FB_ROTATE_CW ) {
@@ -405,8 +407,10 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, image->dy += image->height +8 ; } }else if (rotate ==FB_ROTATE_CCW ) { -for (x =0 ; x < num && image->dy >=0 ; x++) { +for (x =0 ; x < num; x++) { info->fbops->fb_imageblit (info, image); +if (image->dx < image->width +8 ) +break ; image->dy -= image->height +8 ; } }
@@ -1094,7 +1098,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, ret = -EINVAL ;break ; } -if (con2fb.framebuffer <0 || con2fb.framebuffer >=FB_MAX ) { +if (con2fb.framebuffer >=FB_MAX ) { ret = -EINVAL ;break ; }
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword