Skip to content

Commit

Permalink
x86: make 'constant_test_bit()' take an unsigned bit number
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Jan 9, 2009
1 parent e245b80 commit c4295fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c4295fb

Please sign in to comment.