diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-11-12 10:58:27 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-11-12 10:58:27 +0000 |
commit | ec1e20a02fe33b767ffcca8920a32211492416d7 (patch) | |
tree | 85cfc0bbc1aac672b5ee4d540d1eeb2cc0d96f61 /arch/arm/include/asm/spinlock.h | |
parent | 959f58544b7f20c92d5eb43d1232c96c15c01bfb (diff) | |
parent | aed3a4ed7222ae37860ae33cbad3ea7a6b2eaf8e (diff) |
Merge branch 'misc' into for-next
Diffstat (limited to 'arch/arm/include/asm/spinlock.h')
-rw-r--r-- | arch/arm/include/asm/spinlock.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h index 4f2c28060c9a..ed6c22919e47 100644 --- a/arch/arm/include/asm/spinlock.h +++ b/arch/arm/include/asm/spinlock.h @@ -127,10 +127,14 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock) dsb_sev(); } +static inline int arch_spin_value_unlocked(arch_spinlock_t lock) +{ + return lock.tickets.owner == lock.tickets.next; +} + static inline int arch_spin_is_locked(arch_spinlock_t *lock) { - struct __raw_tickets tickets = ACCESS_ONCE(lock->tickets); - return tickets.owner != tickets.next; + return !arch_spin_value_unlocked(ACCESS_ONCE(*lock)); } static inline int arch_spin_is_contended(arch_spinlock_t *lock) |