Skip to contentSkip to conversation

fbdev: Fix test on unsigned in fb_do_show_logo()

PATCH In review Roel Kluin 2 participants 2 messages Oct 16, 2009 – Nov 3, 2009 Framebuffer layer

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 fbdev: Fix test on unsigned in fb_do_show_logo()

image->d[xy] are unsigned so the check was wrong.

---

drivers/video/fbmem.c +4 -2
index 99bbd28..9f20641 100644
@@ -403,7 +403,8 @@ 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 && image->dx + image->width + 8 >= 0;
+				x++) {
 			info->fbops->fb_imageblit(info, image);
 			image->dx -= image->width + 8;
 		}
@@ -415,7 +416,8 @@ 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 && image->dy + image->height + 8 >= 0;
+				x++) {
 			info->fbops->fb_imageblit(info, image);
 			image->dy -= image->height + 8;
 		}

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

#1 lore raw
Quoted 19 lines · On Sat, 17 Oct 2009 00:45:14 +0200 Roel Kluin <[email protected]> wrote:

image->d[xy] are unsigned so the check was wrong.

---

drivers/video/fbmem.c +2 -1
index 99bbd28..9f20641 100644
@@ -403,7 +403,8 @@ 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 && image->dx + image->width + 8 >= 0;
+				x++) {
 			info->fbops->fb_imageblit(info, image);
 			image->dx -= image->width + 8;
 		}

drivers/video/fbmem.c static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, · line 423

Quoted 9 lines
drivers/video/fbmem.c +2 -1
@@ -415,7 +416,8 @@ 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 && image->dy + image->height + 8 >= 0;
+				x++) {
 			info->fbops->fb_imageblit(info, image);
 			image->dy -= image->height + 8;
 		}

Presumably that test isn't needed at all?

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference