Commit 2f528020 authored by Al Viro's avatar Al Viro Committed by Paul E. McKenney

sparc32: make __cmpxchg_u32() return u32

Conversion between u32 and unsigned long is tautological there,
and the only use of return value is to return it from
__cmpxchg() (which return unsigned long).

Get rid of explicit casts in __cmpxchg_u32() call, while we are
at it - normal conversions for arguments will do just fine.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 39cd87c4
...@@ -39,7 +39,7 @@ static __always_inline unsigned long __arch_xchg(unsigned long x, __volatile__ v ...@@ -39,7 +39,7 @@ static __always_inline unsigned long __arch_xchg(unsigned long x, __volatile__ v
/* bug catcher for when unsupported size is used - won't link */ /* bug catcher for when unsupported size is used - won't link */
void __cmpxchg_called_with_bad_pointer(void); void __cmpxchg_called_with_bad_pointer(void);
/* we only need to support cmpxchg of a u32 on sparc */ /* we only need to support cmpxchg of a u32 on sparc */
unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); u32 __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);
/* don't worry...optimizer will get rid of most of this */ /* don't worry...optimizer will get rid of most of this */
static inline unsigned long static inline unsigned long
...@@ -47,7 +47,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) ...@@ -47,7 +47,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
{ {
switch (size) { switch (size) {
case 4: case 4:
return __cmpxchg_u32((u32 *)ptr, (u32)old, (u32)new_); return __cmpxchg_u32(ptr, old, new_);
default: default:
__cmpxchg_called_with_bad_pointer(); __cmpxchg_called_with_bad_pointer();
break; break;
......
...@@ -159,7 +159,7 @@ unsigned long sp32___change_bit(unsigned long *addr, unsigned long mask) ...@@ -159,7 +159,7 @@ unsigned long sp32___change_bit(unsigned long *addr, unsigned long mask)
} }
EXPORT_SYMBOL(sp32___change_bit); EXPORT_SYMBOL(sp32___change_bit);
unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new) u32 __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new)
{ {
unsigned long flags; unsigned long flags;
u32 prev; u32 prev;
...@@ -169,7 +169,7 @@ unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new) ...@@ -169,7 +169,7 @@ unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new)
*ptr = new; *ptr = new;
spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags); spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
return (unsigned long)prev; return prev;
} }
EXPORT_SYMBOL(__cmpxchg_u32); EXPORT_SYMBOL(__cmpxchg_u32);
......
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