summaryrefslogtreecommitdiffstats
path: root/arch/parisc/lib
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-04-02 04:22:50 +0200
committerPaul E. McKenney <paulmck@kernel.org>2024-04-10 07:06:00 +0200
commit29b8e53c1274f0ffda915ac6c0e5c59d14ee208e (patch)
tree818340c32db544c3c02c863ba6b248082ae9afa6 /arch/parisc/lib
parentsparc32: add __cmpxchg_u{8,16}() and teach __cmpxchg() to handle those sizes (diff)
downloadlinux-29b8e53c1274f0ffda915ac6c0e5c59d14ee208e.tar.xz
linux-29b8e53c1274f0ffda915ac6c0e5c59d14ee208e.zip
parisc: __cmpxchg_u32(): lift conversion into the callers
__cmpxchg_u32() return value is unsigned int explicitly cast to unsigned long. Both callers are returns from functions that return unsigned long; might as well have __cmpxchg_u32() return that unsigned int (aka u32) and let the callers convert implicitly. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'arch/parisc/lib')
-rw-r--r--arch/parisc/lib/bitops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
index 36a314199074..ae2231d92198 100644
--- a/arch/parisc/lib/bitops.c
+++ b/arch/parisc/lib/bitops.c
@@ -68,16 +68,16 @@ u64 notrace __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new)
return prev;
}
-unsigned long notrace __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsigned int new)
+u32 notrace __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new)
{
unsigned long flags;
- unsigned int prev;
+ u32 prev;
_atomic_spin_lock_irqsave(ptr, flags);
if ((prev = *ptr) == old)
*ptr = new;
_atomic_spin_unlock_irqrestore(ptr, flags);
- return (unsigned long)prev;
+ return prev;
}
u8 notrace __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new)