Skip to content

Commit afa31d8

Browse files
wildea01Russell King
authored andcommitted
ARM: 7811/1: locks: use early clobber in arch_spin_trylock
The res variable is written before we've finished with the input operands (namely the lock address), so ensure that we mark it as `early clobber' to avoid unintended register sharing. Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent e35ac62 commit afa31d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm/include/asm/spinlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
107107
" subs %1, %0, %0, ror #16\n"
108108
" addeq %0, %0, %4\n"
109109
" strexeq %2, %0, [%3]"
110-
: "=&r" (slock), "=&r" (contended), "=r" (res)
110+
: "=&r" (slock), "=&r" (contended), "=&r" (res)
111111
: "r" (&lock->slock), "I" (1 << TICKET_SHIFT)
112112
: "cc");
113113
} while (res);

0 commit comments

Comments
 (0)