mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Juhl <juhl-lkml@dif.dk>
To: linux-fbdev-devel <linux-fbdev-devel@lists.sourceforge.net>
Cc: Antonino Daplas <adaplas@pol.net>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] remove pointless <0 comparisons in drivers/video/fbmem.c
Date: Mon, 22 Nov 2004 00:45:50 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.61.0411220034040.3423@dragon.hygekrogen.localhost> (raw)


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


             reply	other threads:[~2004-11-21 23:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-21 23:45 Jesper Juhl [this message]
2004-11-22  0:11 ` Antonino A. Daplas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0411220034040.3423@dragon.hygekrogen.localhost \
    --to=juhl-lkml@dif.dk \
    --cc=adaplas@pol.net \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®