Skip to content

Commit

Permalink
ARM: 7867/1: include: asm: use 'int' instead of 'unsigned long' for '…
Browse files Browse the repository at this point in the history
…oldval' in atomic_cmpxchg().

For atomic_cmpxchg(), the type of 'oldval' need be 'int' to match the
type of "*ptr" (used by 'ldrex' instruction) and 'old' (used by 'teq'
instruction).

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Chen Gang authored and Russell King committed Nov 9, 2013
1 parent 237f123 commit 4dcc1cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ static inline int atomic_sub_return(int i, atomic_t *v)

static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
{
unsigned long oldval, res;
int oldval;
unsigned long res;

smp_mb();

Expand Down

0 comments on commit 4dcc1cf

Please sign in to comment.