x86: make 'constant_test_bit()' take an unsigned bit number
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 9 Jan 2009 20:49:50 +0000 (12:49 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 9 Jan 2009 20:49:50 +0000 (12:49 -0800)
Ingo noticed that using signed arithmetic seems to confuse the gcc
inliner, and make it potentially decide that it's all too complicated.

(Yeah, yeah, it's a constant. It's always positive. Still..)

Based-on: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/include/asm/bitops.h

index 9fa9dcdf344baeb25ccfa79db6222b5aae470ba5..e02a359d2aa5c6bcbfb9c5465cfaa8f6bd79e007 100644 (file)
@@ -300,7 +300,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
        return oldbit;
 }
 
-static inline int constant_test_bit(int nr, const volatile unsigned long *addr)
+static inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr)
 {
        return ((1UL << (nr % BITS_PER_LONG)) &
                (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;