linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remove pointless <0 comparisons in drivers/video/fbmem.c
@ 2004-11-21 23:45 Jesper Juhl
  2004-11-22  0:11 ` Antonino A. Daplas
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Juhl @ 2004-11-21 23:45 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Antonino Daplas, linux-kernel


The "console" and "framebuffer" members of struct fb_con2fbmap are both 
unsigned, so it makes no sense to compare them for being <0. Patch to 
remove the pointless comparisons below.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

diff -up linux-2.6.10-rc2-bk6-orig/drivers/video/fbmem.c linux-2.6.10-rc2-bk6/drivers/video/fbmem.c
--- linux-2.6.10-rc2-bk6-orig/drivers/video/fbmem.c	2004-11-21 21:49:10.000000000 +0100
+++ linux-2.6.10-rc2-bk6/drivers/video/fbmem.c	2004-11-22 00:32:49.000000000 +0100
@@ -826,9 +826,9 @@ fb_ioctl(struct inode *inode, struct fil
 	case FBIOPUT_CON2FBMAP:
 		if (copy_from_user(&con2fb, argp, sizeof(con2fb)))
 			return - EFAULT;
-		if (con2fb.console < 0 || con2fb.console > MAX_NR_CONSOLES)
+		if (con2fb.console > MAX_NR_CONSOLES)
 		    return -EINVAL;
-		if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX)
+		if (con2fb.framebuffer >= FB_MAX)
 		    return -EINVAL;
 #ifdef CONFIG_KMOD
 		if (!registered_fb[con2fb.framebuffer])



Please CC me on relies from linux-fbdev-devel

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

* Re: [PATCH] remove pointless <0 comparisons in drivers/video/fbmem.c
  2004-11-21 23:45 [PATCH] remove pointless <0 comparisons in drivers/video/fbmem.c Jesper Juhl
@ 2004-11-22  0:11 ` Antonino A. Daplas
  0 siblings, 0 replies; 2+ messages in thread
From: Antonino A. Daplas @ 2004-11-22  0:11 UTC (permalink / raw)
  To: Jesper Juhl, linux-fbdev-devel; +Cc: Antonino Daplas, linux-kernel

On Monday 22 November 2004 07:45, Jesper Juhl wrote:
> The "console" and "framebuffer" members of struct fb_con2fbmap are both
> unsigned, so it makes no sense to compare them for being <0. Patch to
> remove the pointless comparisons below.

Thanks.

Tony

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

end of thread, other threads:[~2004-11-22  0:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-21 23:45 [PATCH] remove pointless <0 comparisons in drivers/video/fbmem.c Jesper Juhl
2004-11-22  0:11 ` Antonino A. Daplas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).