lkml.org 
[lkml]   [2003]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fix 2.6.0-test4 IDE warning
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

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

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.047 / U:2.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site