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 | Linux 3.12-rc7 (diff) | |
parent | ARM: 7868/1: arm/arm64: remove atomic_clear_mask() in "include/asm/atomic.h" (diff) | |
download | linux-dev-ec1e20a02fe33b767ffcca8920a32211492416d7.tar.xz linux-dev-ec1e20a02fe33b767ffcca8920a32211492416d7.zip |
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) |