* [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
* Re: [PATCH] fix 2.6.0-test4 IDE warning
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
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2003-08-24 10:49 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: B.Zolnierkiewicz, Linux Kernel Development
On Sat, 23 Aug 2003, Mikael Pettersson wrote:
> 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.
Alan rejected this a while ago. He said he'd more like the speed parameter
become an int, but that that would require more changes.
> (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 */
> }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix 2.6.0-test4 IDE warning
2003-08-24 10:49 ` Geert Uytterhoeven
@ 2003-08-27 16:09 ` Alan Cox
0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2003-08-27 16:09 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Mikael Pettersson, Bartlomiej Zolnierkiewicz, Linux Kernel Development
On Sul, 2003-08-24 at 11:49, Geert Uytterhoeven wrote:
> Alan rejected this a while ago. He said he'd more like the speed parameter
> become an int, but that that would require more changes.
Right but its up to Bart for 2.6 now 8)
^ 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).