Commit 2237f4f4 authored by Akinobu Mita's avatar Akinobu Mita Committed by Benjamin Herrenschmidt

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: default avatarAkinobu 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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent c5a0809a
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
#define smp_mb__before_clear_bit() smp_mb() #define smp_mb__before_clear_bit() smp_mb()
#define smp_mb__after_clear_bit() smp_mb() #define smp_mb__after_clear_bit() smp_mb()
#define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
/* Macro for generating the ***_bits() functions */ /* Macro for generating the ***_bits() functions */
...@@ -83,22 +81,22 @@ DEFINE_BITOP(change_bits, xor, "", "") ...@@ -83,22 +81,22 @@ DEFINE_BITOP(change_bits, xor, "", "")
static __inline__ void set_bit(int nr, volatile unsigned long *addr) static __inline__ void set_bit(int nr, volatile unsigned long *addr)
{ {
set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); set_bits(BIT_MASK(nr), addr + BIT_WORD(nr));
} }
static __inline__ void clear_bit(int nr, volatile unsigned long *addr) static __inline__ void clear_bit(int nr, volatile unsigned long *addr)
{ {
clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr));
} }
static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr) static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr)
{ {
clear_bits_unlock(BITOP_MASK(nr), addr + BITOP_WORD(nr)); clear_bits_unlock(BIT_MASK(nr), addr + BIT_WORD(nr));
} }
static __inline__ void change_bit(int nr, volatile unsigned long *addr) static __inline__ void change_bit(int nr, volatile unsigned long *addr)
{ {
change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); change_bits(BIT_MASK(nr), addr + BIT_WORD(nr));
} }
/* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output /* 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,26 +134,26 @@ DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,
static __inline__ int test_and_set_bit(unsigned long nr, static __inline__ int test_and_set_bit(unsigned long nr,
volatile unsigned long *addr) volatile unsigned long *addr)
{ {
return test_and_set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
} }
static __inline__ int test_and_set_bit_lock(unsigned long nr, static __inline__ int test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr) volatile unsigned long *addr)
{ {
return test_and_set_bits_lock(BITOP_MASK(nr), return test_and_set_bits_lock(BIT_MASK(nr),
addr + BITOP_WORD(nr)) != 0; addr + BIT_WORD(nr)) != 0;
} }
static __inline__ int test_and_clear_bit(unsigned long nr, static __inline__ int test_and_clear_bit(unsigned long nr,
volatile unsigned long *addr) volatile unsigned long *addr)
{ {
return test_and_clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
} }
static __inline__ int test_and_change_bit(unsigned long nr, static __inline__ int test_and_change_bit(unsigned long nr,
volatile unsigned long *addr) volatile unsigned long *addr)
{ {
return test_and_change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
} }
#include <asm-generic/bitops/non-atomic.h> #include <asm-generic/bitops/non-atomic.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment