Commit ce323807 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] gcc bug workaround for constant_test_bit()

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!
parent f18d7a18
...@@ -239,9 +239,9 @@ static __inline__ int test_and_change_bit(int nr, volatile unsigned long* addr) ...@@ -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); static int test_bit(int nr, const volatile void * addr);
#endif #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) static __inline__ int variable_test_bit(int nr, const volatile unsigned long * addr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment