All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fbdev: Fix test on unsigned in fb_do_show_logo()
@ 2009-10-16 22:45 Roel Kluin
  2009-11-03  0:32 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-10-16 22:45 UTC (permalink / raw)
  To: Andrew Morton, linux-fbdev-devel, Antonino Daplas

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 99bbd28..9f20641 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fbdev: Fix test on unsigned in fb_do_show_logo()
  2009-10-16 22:45 [PATCH] fbdev: Fix test on unsigned in fb_do_show_logo() Roel Kluin
@ 2009-11-03  0:32 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2009-11-03  0:32 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-fbdev-devel, Antonino Daplas

On Sat, 17 Oct 2009 00:45:14 +0200
Roel Kluin <roel.kluin@gmail.com> wrote:

> image->d[xy] are unsigned so the check was wrong.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
> index 99bbd28..9f20641 100644
> --- a/drivers/video/fbmem.c
> +++ b/drivers/video/fbmem.c
> @@ -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;
>  		}

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-03  0:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16 22:45 [PATCH] fbdev: Fix test on unsigned in fb_do_show_logo() Roel Kluin
2009-11-03  0:32 ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.