Signdness issue in drivers/video/intelfb/intelfbdrv.c
PATCH 1/1 Signdness issue in drivers/video/intelfb/intelfbdrv.c
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()
drivers/video/intelfb/intelfbdrv.c renamed from drivers/video/intelfb/intelfbdrv.c.orig +3 -2
@@ -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)
Dave Airlie
NAKQuoted 4 lines · Eric Sesterhenn
hi,
another gcc 4.1 signess warning:
Quoted 8 lines
drivers/video/intelfb/intelfbdrv.c:419: warning: comparison of unsigned expression < 0 is always falsesince
dinfo->mtrr_regis of the type u32, the error checkdinfo->mtrr_reg< 0 is useless. This patch introduces a helper variable, which catches possible negative error values returned bymtrr_add()Signed-off-by Eric Sesterhenn <[email protected]>
NAK.
I've applied a much simpler fix to use make mtrr_reg an int to my intelfb tree....
Dave.