bitops: Change the bitmap index from int to unsigned long [x86]
Subsystems (3)
PATCH 13/15 bitops: Change the bitmap index from int to unsigned long [x86]
Change the index to unsigned long in all bitops for [x86]
Signed-off-by Justin Chen <[email protected]>
Reviewed-by Bjorn Helgaas <[email protected]>
--- arch/x86/boot/bitops.h | 6 ++--- arch/x86/include/asm/bitops.h | 48 +++++++++++++++++++++++++++++----------------- arch/x86/include/asm/sync_bitops.h | 18 +++++++++++------ 3 files changed, 46 insertions(+), 26 deletions(-)
arch/x86/boot/bitops.h +3 -3
@@ -16,12 +16,12 @@#define BOOT_BITOPS_H #define _LINUX_BITOPS_H/* Inhibit inclusion of <linux/bitops.h> */ -static inline int constant_test_bit (int nr,const void *addr) +static inline int constant_test_bit (unsigned long nr,const void *addr) {const u32 *p = (const u32 *)addr;return ((1UL << (nr &31 )) & (p[nr >>5 ])) !=0 ; } -static inline int variable_test_bit (int nr,const void *addr) +static inline int variable_test_bit (unsigned long nr,const void *addr) {u8 v;const u32 *p = (const u32 *)addr;
@@ -35,7 +35,7 @@ constant_test_bit((nr),(addr)) : \ variable_test_bit((nr),(addr))) -static inline void set_bit (int nr,void *addr) +static inline void set_bit (unsigned long nr,void *addr) { asm("btsl %1,%0" :"+m" (*(u32 *)addr) :"Ir" (nr)); }
arch/x86/include/asm/bitops.h +31 -17
148 lines not on this page · raw message
arch/x86/include/asm/sync_bitops.h +12 -6
@@ -26,7 +26,8 @@* Note that @nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void sync_set_bit (int nr,volatile unsigned long *addr) +static inline void +sync_set_bit (unsigned long nr,volatile unsigned long *addr) { asmvolatile ("lock; btsl %1,%0" : "+m" (ADDR)
@@ -44,7 +45,8 @@* you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit() * in order to ensure changes are visible on other processors. */ -static inline void sync_clear_bit (int nr,volatile unsigned long *addr) +static inline void +sync_clear_bit (unsigned long nr,volatile unsigned long *addr) { asmvolatile ("lock; btrl %1,%0" : "+m" (ADDR)
@@ -61,7 +63,8 @@* Note that @nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void sync_change_bit (int nr,volatile unsigned long *addr) +static inline void +sync_change_bit (unsigned long nr,volatile unsigned long *addr) { asmvolatile ("lock; btcl %1,%0" : "+m" (ADDR)
@@ -77,7 +80,8 @@* This operation is atomic and cannot be reordered. * It also implies a memory barrier. */ -static inline int sync_test_and_set_bit (int nr,volatile unsigned long *addr) +static inline int +sync_test_and_set_bit (unsigned long nr,volatile unsigned long *addr) {int oldbit;
@@ -95,7 +99,8 @@* This operation is atomic and cannot be reordered. * It also implies a memory barrier. */ -static inline int sync_test_and_clear_bit (int nr,volatile unsigned long *addr) +static inline int +sync_test_and_clear_bit (unsigned long nr,volatile unsigned long *addr) {int oldbit;
@@ -113,7 +118,8 @@* This operation is atomic and cannot be reordered. * It also implies a memory barrier. */ -static inline int sync_test_and_change_bit (int nr,volatile unsigned long *addr) +static inline int +sync_test_and_change_bit (unsigned long nr,volatile unsigned long *addr) {int oldbit;