Skip to content

Commit 29b8e53

Browse files
Al Viropaulmckrcu
authored andcommitted
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 <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent dbc93fd commit 29b8e53

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

arch/parisc/include/asm/cmpxchg.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ __arch_xchg(unsigned long x, volatile void *ptr, int size)
5757
extern void __cmpxchg_called_with_bad_pointer(void);
5858

5959
/* __cmpxchg_u32/u64 defined in arch/parisc/lib/bitops.c */
60-
extern unsigned long __cmpxchg_u32(volatile unsigned int *m, unsigned int old,
61-
unsigned int new_);
60+
extern u32 __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);
6261
extern u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new_);
6362
extern u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new_);
6463

arch/parisc/lib/bitops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ u64 notrace __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new)
6868
return prev;
6969
}
7070

71-
unsigned long notrace __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsigned int new)
71+
u32 notrace __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new)
7272
{
7373
unsigned long flags;
74-
unsigned int prev;
74+
u32 prev;
7575

7676
_atomic_spin_lock_irqsave(ptr, flags);
7777
if ((prev = *ptr) == old)
7878
*ptr = new;
7979
_atomic_spin_unlock_irqrestore(ptr, flags);
80-
return (unsigned long)prev;
80+
return prev;
8181
}
8282

8383
u8 notrace __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new)

0 commit comments

Comments
 (0)