Skip to content

Commit c4295fb

Browse files
committed
x86: make 'constant_test_bit()' take an unsigned bit number
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>
1 parent e245b80 commit c4295fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/include/asm/bitops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
300300
return oldbit;
301301
}
302302

303-
static inline int constant_test_bit(int nr, const volatile unsigned long *addr)
303+
static inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr)
304304
{
305305
return ((1UL << (nr % BITS_PER_LONG)) &
306306
(((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;

0 commit comments

Comments
 (0)