Skip to content

Commit 050026f

Browse files
committed
Merge branch 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: Avoid 'constant_test_bit()' misoptimization due to cast to non-volatile
2 parents 252a52a + c9e2fbd commit 050026f

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
@@ -309,7 +309,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
309309
static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr)
310310
{
311311
return ((1UL << (nr % BITS_PER_LONG)) &
312-
(((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;
312+
(addr[nr / BITS_PER_LONG])) != 0;
313313
}
314314

315315
static inline int variable_test_bit(int nr, volatile const unsigned long *addr)

0 commit comments

Comments
 (0)