* [PATCH] Signdness issue in drivers/video/intelfb/intelfbdrv.c
@ 2006-08-20 19:03 Eric Sesterhenn
2006-08-22 0:15 ` Dave Airlie
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sesterhenn @ 2006-08-20 19:03 UTC (permalink / raw)
To: linux-kernel
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Signdness issue in drivers/video/intelfb/intelfbdrv.c
2006-08-20 19:03 [PATCH] Signdness issue in drivers/video/intelfb/intelfbdrv.c Eric Sesterhenn
@ 2006-08-22 0:15 ` Dave Airlie
0 siblings, 0 replies; 2+ messages in thread
From: Dave Airlie @ 2006-08-22 0:15 UTC (permalink / raw)
To: Eric Sesterhenn; +Cc: linux-kernel, Andrew Morton
On 8/21/06, Eric Sesterhenn <snakebyte@gmx.de> wrote:
> 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>
>
NAK.
I've applied a much simpler fix to use make mtrr_reg an int to my
intelfb tree....
Dave.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-22 0:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-20 19:03 [PATCH] Signdness issue in drivers/video/intelfb/intelfbdrv.c Eric Sesterhenn
2006-08-22 0:15 ` Dave Airlie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox