summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/spinlock.h
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2012-02-03 15:06:26 +0000
committerIngo Molnar <mingo@elte.hu>2012-02-07 10:09:54 +0100
commit7931d493051ea9b09e4fddee2dc40b2eb88d62b9 (patch)
tree5203f257b0eb4faefe7c0092900899965bbc10e0 /arch/x86/include/asm/spinlock.h
parent9d8e22777e66f420e46490e9fc6f8cb7e0e2222b (diff)
downloadlinux-0-day-7931d493051ea9b09e4fddee2dc40b2eb88d62b9.tar.gz
linux-0-day-7931d493051ea9b09e4fddee2dc40b2eb88d62b9.tar.xz
x86/spinlocks: Eliminate TICKET_MASK
The definition of it being questionable already (unnecessarily including a cast), and it being used in a single place that can be written shorter without it, remove this #define. Along the same lines, simplify __ticket_spin_is_locked()'s main expression, which was the more convoluted way because of needs that went away with the recent type changes by Jeremy. This is pure cleanup, no functional change intended. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/4F2C06020200007800071066@nat28.tlf.novell.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/spinlock.h')
-rw-r--r--arch/x86/include/asm/spinlock.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index a82c2bf504b60..76bfa2cf301df 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -88,14 +88,14 @@ static inline int __ticket_spin_is_locked(arch_spinlock_t *lock)
{
struct __raw_tickets tmp = ACCESS_ONCE(lock->tickets);
- return !!(tmp.tail ^ tmp.head);
+ return tmp.tail != tmp.head;
}
static inline int __ticket_spin_is_contended(arch_spinlock_t *lock)
{
struct __raw_tickets tmp = ACCESS_ONCE(lock->tickets);
- return ((tmp.tail - tmp.head) & TICKET_MASK) > 1;
+ return (__ticket_t)(tmp.tail - tmp.head) > 1;
}
#ifndef CONFIG_PARAVIRT_SPINLOCKS