[PATCH 12/15] bitops: Change the bitmap index from int to unsigned long [sh]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change the index to unsigned long in all bitops for [sh]

Signed-off-by: Justin Chen <justin.chen@xxxxxx>
Reviewed-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx>
---
 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(-)
diff -Nru a/arch/sh/include/asm/bitops-grb.h b/arch/sh/include/asm/bitops-grb.h
--- a/arch/sh/include/asm/bitops-grb.h	2009-02-13 15:31:30.000000000 -0800
+++ b/arch/sh/include/asm/bitops-grb.h	2009-02-15 18:19:39.785228522 -0800
@@ -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;
diff -Nru a/arch/sh/include/asm/bitops-llsc.h b/arch/sh/include/asm/bitops-llsc.h
--- a/arch/sh/include/asm/bitops-llsc.h	2009-02-13 15:31:30.000000000 -0800
+++ b/arch/sh/include/asm/bitops-llsc.h	2009-02-15 18:19:39.785228522 -0800
@@ -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;
diff -Nru a/arch/sh/include/asm/bitops-op32.h b/arch/sh/include/asm/bitops-op32.h
--- a/arch/sh/include/asm/bitops-op32.h	2009-02-13 15:31:30.000000000 -0800
+++ b/arch/sh/include/asm/bitops-op32.h	2009-02-15 18:19:39.786205084 -0800
@@ -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)));
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux