linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix 2.6.0-test4 IDE warning
@ 2003-08-23 17:05 Mikael Pettersson
  2003-08-24 10:49 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Pettersson @ 2003-08-23 17:05 UTC (permalink / raw)
  To: B.Zolnierkiewicz; +Cc: linux-kernel

Compiling IDE in 2.6.0-test4 with CONFIG_BLK_DEV_IDEDMA=n results in:

  gcc -Wp,-MD,drivers/ide/.ide-lib.o.d -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i486 -Iinclude/asm-i386/mach-default -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i486 -Iinclude/asm-i386/mach-default -fomit-frame-pointer -nostdinc -iwithprefix include    -DKBUILD_BASENAME=ide_lib -DKBUILD_MODNAME=ide_lib -c -o drivers/ide/ide-lib.o drivers/ide/ide-lib.c
drivers/ide/ide-lib.c: In function `ide_rate_filter':
drivers/ide/ide-lib.c:173: warning: comparison of distinct pointer types lacks a cast

This is because the type-checking min() macro is applied to a u8
variable and an int constant, resulting in a type mismatch. Fix below.

(CONFIG_BLK_DEV_IDEDMA=n is what one gets on an old PCI-less 486.)

/Mikael

--- linux-2.6.0-test4/drivers/ide/ide-lib.c.~1~	2003-08-09 11:54:06.000000000 +0200
+++ linux-2.6.0-test4/drivers/ide/ide-lib.c	2003-08-23 18:43:52.000000000 +0200
@@ -170,7 +170,7 @@
 		BUG();
 	return min(speed, speed_max[mode]);
 #else /* !CONFIG_BLK_DEV_IDEDMA */
-	return min(speed, XFER_PIO_4);
+	return min(speed, (u8)XFER_PIO_4);
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-08-27 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-23 17:05 [PATCH] fix 2.6.0-test4 IDE warning Mikael Pettersson
2003-08-24 10:49 ` Geert Uytterhoeven
2003-08-27 16:09   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).