[PATCH] Signdness issue in drivers/video/intelfb/intelfbdrv.c

From: Eric Sesterhenn
Date: Sun Aug 20 2006 - 15:01:14 EST


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@xxxxxx>

--- 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)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/