Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1405391

[PATCH] spinlock: Get rid of spin_can_lock()

From Davidlohr Bueso <dave@stgolabs.net>
Newsgroups linux.kernel
Subject [PATCH] spinlock: Get rid of spin_can_lock()
Date 2016-05-23 16:00 +0200
Message-ID <rBYyK-6yX-25@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


... it has no users and we already have the the regular spin_is_lock()
call anyway -- although iirc this was going to be different
than the simple negation for lock elision implementations. Lets drop it.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
 include/linux/spinlock.h | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 47dd0cebd204..047c6f6c3268 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -264,12 +264,6 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
 	1 : ({ local_irq_restore(flags); 0; }); \
 })
 
-/**
- * raw_spin_can_lock - would raw_spin_trylock() succeed?
- * @lock: the spinlock in question.
- */
-#define raw_spin_can_lock(lock)	(!raw_spin_is_locked(lock))
-
 /* Include rwlock functions */
 #include <linux/rwlock.h>
 
@@ -392,11 +386,6 @@ static __always_inline int spin_is_contended(spinlock_t *lock)
 	return raw_spin_is_contended(&lock->rlock);
 }
 
-static __always_inline int spin_can_lock(spinlock_t *lock)
-{
-	return raw_spin_can_lock(&lock->rlock);
-}
-
 #define assert_spin_locked(lock)	assert_raw_spin_locked(&(lock)->rlock)
 
 /*
-- 
2.8.2

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] spinlock: Get rid of spin_can_lock() Davidlohr Bueso <dave@stgolabs.net> - 2016-05-23 16:00 +0200
  Re: [PATCH] spinlock: Get rid of spin_can_lock() Peter Zijlstra <peterz@infradead.org> - 2016-05-24 12:30 +0200

csiph-web