diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-11-03 22:03:44 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-14 21:01:07 -0500 |
commit | 2237f4f40af9ab57d5427b35d1514d3e65d31d1a (patch) | |
tree | efa16ad219a2dc39b596bb54c20f79f6245c159a /arch | |
parent | c5a0809a24c19fcefea5f3aeb07bde9a2dee5d80 (diff) |
powerpc: Remove BITOP_MASK and BITOP_WORD from asm/bitops.h
Replace BITOP_MASK and BITOP_WORD with BIT_MASK and BIT_WORD defined
in linux/bitops.h and remove BITOP_* which are not used anymore.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/bitops.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h index dc2cf9c6d9e6..920596f3b2af 100644 --- a/arch/powerpc/include/asm/bitops.h +++ b/arch/powerpc/include/asm/bitops.h | |||
@@ -52,8 +52,6 @@ | |||
52 | #define smp_mb__before_clear_bit() smp_mb() | 52 | #define smp_mb__before_clear_bit() smp_mb() |
53 | #define smp_mb__after_clear_bit() smp_mb() | 53 | #define smp_mb__after_clear_bit() smp_mb() |
54 | 54 | ||
55 | #define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) | ||
56 | #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) | ||
57 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) | 55 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) |
58 | 56 | ||
59 | /* Macro for generating the ***_bits() functions */ | 57 | /* Macro for generating the ***_bits() functions */ |
@@ -83,22 +81,22 @@ DEFINE_BITOP(change_bits, xor, "", "") | |||
83 | 81 | ||
84 | static __inline__ void set_bit(int nr, volatile unsigned long *addr) | 82 | static __inline__ void set_bit(int nr, volatile unsigned long *addr) |
85 | { | 83 | { |
86 | set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); | 84 | set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); |
87 | } | 85 | } |
88 | 86 | ||
89 | static __inline__ void clear_bit(int nr, volatile unsigned long *addr) | 87 | static __inline__ void clear_bit(int nr, volatile unsigned long *addr) |
90 | { | 88 | { |
91 | clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); | 89 | clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); |
92 | } | 90 | } |
93 | 91 | ||
94 | static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr) | 92 | static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr) |
95 | { | 93 | { |
96 | clear_bits_unlock(BITOP_MASK(nr), addr + BITOP_WORD(nr)); | 94 | clear_bits_unlock(BIT_MASK(nr), addr + BIT_WORD(nr)); |
97 | } | 95 | } |
98 | 96 | ||
99 | static __inline__ void change_bit(int nr, volatile unsigned long *addr) | 97 | static __inline__ void change_bit(int nr, volatile unsigned long *addr) |
100 | { | 98 | { |
101 | change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); | 99 | change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); |
102 | } | 100 | } |
103 | 101 | ||
104 | /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output | 102 | /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output |
@@ -136,26 +134,26 @@ DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER, | |||
136 | static __inline__ int test_and_set_bit(unsigned long nr, | 134 | static __inline__ int test_and_set_bit(unsigned long nr, |
137 | volatile unsigned long *addr) | 135 | volatile unsigned long *addr) |
138 | { | 136 | { |
139 | return test_and_set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; | 137 | return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; |
140 | } | 138 | } |
141 | 139 | ||
142 | static __inline__ int test_and_set_bit_lock(unsigned long nr, | 140 | static __inline__ int test_and_set_bit_lock(unsigned long nr, |
143 | volatile unsigned long *addr) | 141 | volatile unsigned long *addr) |
144 | { | 142 | { |
145 | return test_and_set_bits_lock(BITOP_MASK(nr), | 143 | return test_and_set_bits_lock(BIT_MASK(nr), |
146 | addr + BITOP_WORD(nr)) != 0; | 144 | addr + BIT_WORD(nr)) != 0; |
147 | } | 145 | } |
148 | 146 | ||
149 | static __inline__ int test_and_clear_bit(unsigned long nr, | 147 | static __inline__ int test_and_clear_bit(unsigned long nr, |
150 | volatile unsigned long *addr) | 148 | volatile unsigned long *addr) |
151 | { | 149 | { |
152 | return test_and_clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; | 150 | return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; |
153 | } | 151 | } |
154 | 152 | ||
155 | static __inline__ int test_and_change_bit(unsigned long nr, | 153 | static __inline__ int test_and_change_bit(unsigned long nr, |
156 | volatile unsigned long *addr) | 154 | volatile unsigned long *addr) |
157 | { | 155 | { |
158 | return test_and_change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; | 156 | return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; |
159 | } | 157 | } |
160 | 158 | ||
161 | #include <asm-generic/bitops/non-atomic.h> | 159 | #include <asm-generic/bitops/non-atomic.h> |