lkml.org 
[lkml]   [2013]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/2] x86,smp: simplify __ticket_spin_lock
Just cosmetic - avoid an unnecessary goto construct

Signed-off-by: Michel Lespinasse <walken@google.com>

---
arch/x86/include/asm/spinlock.h | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index 2a45eb0cdb2c..19e8a36b3b83 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -55,11 +55,8 @@ static __always_inline void __ticket_spin_lock(arch_spinlock_t *lock)

inc = xadd(&lock->tickets, inc);

- if (inc.head == inc.tail)
- goto out;
-
- ticket_spin_lock_wait(lock, inc);
- out:
+ if (inc.head != inc.tail)
+ ticket_spin_lock_wait(lock, inc);
barrier(); /* make sure nothing creeps before the lock is taken */
}

--
1.7.7.3

\
 
 \ /
  Last update: 2013-01-02 01:41    [W:0.237 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site