bitops: Change the bitmap index from int to unsigned long [sh]
Subsystems (2)
PATCH 12/15 bitops: Change the bitmap index from int to unsigned long [sh]
Change the index to unsigned long in all bitops for [sh]
Signed-off-by Justin Chen <[email protected]>
Reviewed-by Bjorn Helgaas <[email protected]>
--- arch/sh/include/asm/bitops-grb.h | 12 ++++++------ arch/sh/include/asm/bitops-llsc.h | 12 ++++++------ arch/sh/include/asm/bitops-op32.h | 19 +++++++++++-------- 3 files changed, 23 insertions(+), 20 deletions(-)
arch/sh/include/asm/bitops-grb.h +6 -6
@@ -1,7 +1,7 @@#ifndef __ASM_SH_BITOPS_GRB_H#define __ASM_SH_BITOPS_GRB_H -static inline void set_bit (int nr,volatile void * addr) +static inline void set_bit (unsigned long nr,volatile void *addr) {int mask;volatile unsigned int *a = addr;
@@ -25,7 +25,7 @@ : "memory" , "r0", "r1"); } -static inline void clear_bit (int nr,volatile void * addr) +static inline void clear_bit (unsigned long nr,volatile void *addr) {int mask;volatile unsigned int *a = addr;
@@ -48,7 +48,7 @@ : "memory" , "r0", "r1"); } -static inline void change_bit (int nr,volatile void * addr) +static inline void change_bit (unsigned long nr,volatile void *addr) {int mask;volatile unsigned int *a = addr;
@@ -71,7 +71,7 @@ : "memory" , "r0", "r1"); } -static inline int test_and_set_bit (int nr,volatile void * addr) +static inline int test_and_set_bit (unsigned long nr,volatile void *addr) {int mask, retval;volatile unsigned int *a = addr;
@@ -102,7 +102,7 @@return retval; } -static inline int test_and_clear_bit (int nr,volatile void * addr) +static inline int test_and_clear_bit (unsigned long nr,volatile void *addr) {int mask, retval,not_mask;volatile unsigned int *a = addr;
@@ -136,7 +136,7 @@return retval; } -static inline int test_and_change_bit (int nr,volatile void * addr) +static inline int test_and_change_bit (unsigned long nr,volatile void *addr) {int mask, retval;volatile unsigned int *a = addr;
arch/sh/include/asm/bitops-llsc.h +6 -6
@@ -1,7 +1,7 @@#ifndef __ASM_SH_BITOPS_LLSC_H#define __ASM_SH_BITOPS_LLSC_H -static inline void set_bit (int nr,volatile void * addr) +static inline void set_bit (unsigned long nr,volatile void *addr) {int mask;volatile unsigned int *a = addr;
@@ -22,7 +22,7 @@ ); } -static inline void clear_bit (int nr,volatile void * addr) +static inline void clear_bit (unsigned long nr,volatile void *addr) {int mask;volatile unsigned int *a = addr;
@@ -43,7 +43,7 @@ ); } -static inline void change_bit (int nr,volatile void * addr) +static inline void change_bit (unsigned long nr,volatile void *addr) {int mask;volatile unsigned int *a = addr;
@@ -64,7 +64,7 @@ ); } -static inline int test_and_set_bit (int nr,volatile void * addr) +static inline int test_and_set_bit (unsigned long nr,volatile void *addr) {int mask, retval;volatile unsigned int *a = addr;
@@ -89,7 +89,7 @@return retval !=0 ; } -static inline int test_and_clear_bit (int nr,volatile void * addr) +static inline int test_and_clear_bit (unsigned long nr,volatile void *addr) {int mask, retval;volatile unsigned int *a = addr;
@@ -115,7 +115,7 @@return retval !=0 ; } -static inline int test_and_change_bit (int nr,volatile void * addr) +static inline int test_and_change_bit (unsigned long nr,volatile void *addr) {int mask, retval;volatile unsigned int *a = addr;
arch/sh/include/asm/bitops-op32.h +11 -8
@@ -17,7 +17,7 @@#define IS_IMMEDIATE (nr) (__builtin_constant_p(nr)) -static inline void __set_bit (int nr,volatile unsigned long *addr) +static inline void __set_bit (unsigned long nr,volatile unsigned long *addr) {if (IS_IMMEDIATE (nr)) { __asm__ __volatile__ (
@@ -34,7 +34,7 @@ } } -static inline void __clear_bit (int nr,volatile unsigned long *addr) +static inline void __clear_bit (unsigned long nr,volatile unsigned long *addr) {if (IS_IMMEDIATE (nr)) { __asm__ __volatile__ (
@@ -61,7 +61,7 @@* If it's called on the same region of memory simultaneously, the effect * may be that only one operation succeeds. */ -static inline void __change_bit (int nr,volatile unsigned long *addr) +static inline void __change_bit (unsigned long nr,volatile unsigned long *addr) {if (IS_IMMEDIATE (nr)) { __asm__ __volatile__ (
@@ -88,7 +88,8 @@* If two examples of this operation race, one can appear to succeed * but actually fail. You must protect multiple accesses with a lock. */ -static inline int __test_and_set_bit (int nr,volatile unsigned long *addr) +static inline int +__test_and_set_bit (unsigned long nr,volatile unsigned long *addr) {unsigned long mask =BIT_MASK (nr);unsigned long *p = ((unsigned long *)addr) +BIT_WORD (nr);
@@ -107,7 +108,8 @@* If two examples of this operation race, one can appear to succeed * but actually fail. You must protect multiple accesses with a lock. */ -static inline int __test_and_clear_bit (int nr,volatile unsigned long *addr) +static inline int +__test_and_clear_bit (unsigned long nr,volatile unsigned long *addr) {unsigned long mask =BIT_MASK (nr);unsigned long *p = ((unsigned long *)addr) +BIT_WORD (nr);
@@ -118,8 +120,8 @@ }/* WARNING: non atomic and it can be reordered! */ -static inline int __test_and_change_bit (int nr, -volatile unsigned long *addr) +static inline int +__test_and_change_bit (unsigned long nr,volatile unsigned long *addr) {unsigned long mask =BIT_MASK (nr);unsigned long *p = ((unsigned long *)addr) +BIT_WORD (nr);
@@ -134,7 +136,8 @@* @nr: bit number to test * @addr: Address to start counting from */ -static inline int test_bit (int nr,const volatile unsigned long *addr) +static inline int +test_bit (unsigned long nr,const volatile unsigned long *addr) {return 1UL & (addr[BIT_WORD (nr)] >> (nr & (BITS_PER_LONG -1 ))); }