From: Will Deacon Date: Mon, 12 Aug 2013 17:03:26 +0000 (+0100) Subject: ARM: 7811/1: locks: use early clobber in arch_spin_trylock X-Git-Tag: accepted/tizen/common/20141203.182822~1657^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=afa31d8eb86fc2f25083e675d57ac8173a98f999;p=platform%2Fkernel%2Flinux-arm64.git 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 Signed-off-by: Russell King --- diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h index f8b8965..7ed43f68 100644 --- a/arch/arm/include/asm/spinlock.h +++ b/arch/arm/include/asm/spinlock.h @@ -107,7 +107,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) " subs %1, %0, %0, ror #16\n" " addeq %0, %0, %4\n" " strexeq %2, %0, [%3]" - : "=&r" (slock), "=&r" (contended), "=r" (res) + : "=&r" (slock), "=&r" (contended), "=&r" (res) : "r" (&lock->slock), "I" (1 << TICKET_SHIFT) : "cc"); } while (res);