From: Andi Kleen Date: Wed, 25 Apr 2012 01:03:53 +0000 (+1000) Subject: include/linux/spinlock.h: add a kerneldoc comment to spin_is_locked() that discourage... X-Git-Tag: next-20120430~2^2~97 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=366c0450cd228f1ad2a4a19f548782d2d5803aa3;p=karo-tx-linux.git include/linux/spinlock.h: add a kerneldoc comment to spin_is_locked() that discourages its use Signed-off-by: Andi Kleen Cc: Wolfram Sang Signed-off-by: Andrew Morton --- diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 7d537ced949a..d7a040904323 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -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);