]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
include/linux/spinlock.h: add a kerneldoc comment to spin_is_locked() that discourage...
authorAndi Kleen <ak@linux.intel.com>
Wed, 4 Apr 2012 00:08:27 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 4 Apr 2012 03:22:10 +0000 (13:22 +1000)
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/spinlock.h

index 7d537ced949aa83b33b4c20e32c991d2123ca5a5..d7a040904323444bbc764eac7325ef4859055361 100644 (file)
@@ -360,6 +360,15 @@ static inline void spin_unlock_wait(spinlock_t *lock)
        raw_spin_unlock_wait(&lock->rlock);
 }
 
+/**
+ * spin_is_locked() - Check if a spinlock is being held.
+ * @lock: Lock to check.
+ *
+ * This function should normally not be used. Especially using it in
+ * WARN and BUG_ONs is usually incorrect or redundant.
+ * If you want to check if a lock is held in a function
+ * use lockdep_assert_held(). A lot of other usages are racy.
+ */
 static inline int spin_is_locked(spinlock_t *lock)
 {
        return raw_spin_is_locked(&lock->rlock);