From c028a59d00be5a408fb8e9b545b15a6ad017f911 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 3 Feb 2012 15:06:26 +0000 Subject: [PATCH] --- yaml --- r: 292702 b: refs/heads/master c: 7931d493051ea9b09e4fddee2dc40b2eb88d62b9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/spinlock.h | 4 ++-- trunk/arch/x86/include/asm/spinlock_types.h | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 308357d25685..858dffb709ec 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9d8e22777e66f420e46490e9fc6f8cb7e0e2222b +refs/heads/master: 7931d493051ea9b09e4fddee2dc40b2eb88d62b9 diff --git a/trunk/arch/x86/include/asm/spinlock.h b/trunk/arch/x86/include/asm/spinlock.h index a82c2bf504b6..76bfa2cf301d 100644 --- a/trunk/arch/x86/include/asm/spinlock.h +++ b/trunk/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 diff --git a/trunk/arch/x86/include/asm/spinlock_types.h b/trunk/arch/x86/include/asm/spinlock_types.h index 8ebd5df7451e..ad0ad07fc006 100644 --- a/trunk/arch/x86/include/asm/spinlock_types.h +++ b/trunk/arch/x86/include/asm/spinlock_types.h @@ -16,7 +16,6 @@ typedef u32 __ticketpair_t; #endif #define TICKET_SHIFT (sizeof(__ticket_t) * 8) -#define TICKET_MASK ((__ticket_t)((1 << TICKET_SHIFT) - 1)) typedef struct arch_spinlock { union {