public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Signdness issue in drivers/video/intelfb/intelfbdrv.c
Date: Sun, 20 Aug 2006 21:03:45 +0200	[thread overview]
Message-ID: <1156100625.3687.6.camel@alice> (raw)

hi,

another gcc 4.1 signess warning:

drivers/video/intelfb/intelfbdrv.c:419: warning: comparison of unsigned expression < 0 is always false

since dinfo->mtrr_reg is of the type u32, the error check dinfo->mtrr_reg < 0
is useless. This patch introduces a helper variable, which catches possible
negative error values returned by mtrr_add()

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.18-rc4/drivers/video/intelfb/intelfbdrv.c.orig	2006-08-20 20:46:11.000000000 +0200
+++ linux-2.6.18-rc4/drivers/video/intelfb/intelfbdrv.c	2006-08-20 20:47:14.000000000 +0200
@@ -414,12 +414,13 @@ module_exit(intelfb_exit);
 #ifdef CONFIG_MTRR
 static inline void __devinit set_mtrr(struct intelfb_info *dinfo)
 {
-	dinfo->mtrr_reg = mtrr_add(dinfo->aperture.physical,
+	int mtrr_reg = mtrr_add(dinfo->aperture.physical,
 				   dinfo->aperture.size, MTRR_TYPE_WRCOMB, 1);
-	if (dinfo->mtrr_reg < 0) {
+	if (mtrr_reg < 0) {
 		ERR_MSG("unable to set MTRR\n");
 		return;
 	}
+	dinfo->mtrr_reg = mtrr_reg;
 	dinfo->has_mtrr = 1;
 }
 static inline void unset_mtrr(struct intelfb_info *dinfo)



             reply	other threads:[~2006-08-20 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-20 19:03 Eric Sesterhenn [this message]
2006-08-22  0:15 ` [PATCH] Signdness issue in drivers/video/intelfb/intelfbdrv.c Dave Airlie

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=1156100625.3687.6.camel@alice \
    --to=snakebyte@gmx.de \
    --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