]> git.hungrycats.org Git - linux/commitdiff
[PATCH] gcc bug workaround for constant_test_bit()
authorAndrew Morton <akpm@osdl.org>
Tue, 18 Nov 2003 16:14:25 +0000 (08:14 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 18 Nov 2003 16:14:25 +0000 (08:14 -0800)
From: Zwane Mwaikambo <zwane@arm.linux.org.uk>

gcc-3.2.2-5 miscompiles constant_test_bit().  Tweak it so the compiler gets
it right.  It cleans it up too!

include/asm-i386/bitops.h

index a9a123b13ba2581649e3c9be6198337d39fe0f53..c39edc67d1111c699b1ecec177ec8419c1dd1b4e 100644 (file)
@@ -239,9 +239,9 @@ static __inline__ int test_and_change_bit(int nr, volatile unsigned long* addr)
 static int test_bit(int nr, const volatile void * addr);
 #endif
 
-static __inline__ int constant_test_bit(int nr, const volatile unsigned long * addr)
+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;
 }
 
 static __inline__ int variable_test_bit(int nr, const volatile unsigned long * addr)