From d1ab824be43842ae7429ab1df37153e1cebb4d32 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Tue, 8 May 2007 00:30:22 -0700 Subject: [PATCH] Document SPIN_LOCK_UNLOCKED/RW_LOCK_UNLOCKED deprecation Apparently it's not cool anymore to use SPIN/RW_LOCK_UNLOCKED. There's some mention of this in Documentation/spinlocks.txt, but that only talks about dynamic initialisation. A comment in the code mentioning the preferred usage would be good IMHO. [akpm@linux-foundation.org: add reason for deprecation] Signed-off-by: Michael Ellerman Acked-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/spinlock_types.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h index dc5fb69e4d..210549ba4e 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h @@ -85,6 +85,12 @@ typedef struct { RW_DEP_MAP_INIT(lockname) } #endif +/* + * SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and + * are hence deprecated. + * Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or + * __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate. + */ #define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) #define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) -- 2.20.1