Re: [PATCH][2.6] constant_test_bit doesn't like my gcc

From: Andrew Morton
Date: Wed Oct 15 2003 - 23:18:46 EST


Zwane Mwaikambo <zwane@xxxxxxxxxxxxxxxx> wrote:
>
> > The volatile is rather important.
>
> Good point, how about;
>
> Index: linux-2.6.0-test7-mm1/include/asm-i386/bitops.h
> ===================================================================
> RCS file: /build/cvsroot/linux-2.6.0-test7-mm1/include/asm-i386/bitops.h,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 bitops.h
> --- linux-2.6.0-test7-mm1/include/asm-i386/bitops.h 15 Oct 2003 09:02:10 -0000 1.1.1.1
> +++ linux-2.6.0-test7-mm1/include/asm-i386/bitops.h 16 Oct 2003 04:10:37 -0000
> @@ -241,7 +241,7 @@ static int test_bit(int nr, const volati
>
> static __inline__ int constant_test_bit(int nr, const volatile unsigned long * addr)
> {
> - return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
> + return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
> }
>

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