Skip to contentSkip to conversation

Document SPIN_LOCK_UNLOCKED/RW_LOCK_UNLOCKED deprecation

PATCH In review Michael Ellerman 2 participants 2 messages Apr 18, 2007 Locking primitives

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

 include/linux/spinlock_types.h |    5 +++++
 1 file changed, 5 insertions(+)
include/linux/spinlock_types.h +5 -0
Index: powerpc/include/linux/spinlock_types.h
===================================================================
@@ -85,6 +85,11 @@ typedef struct {
 				RW_DEP_MAP_INIT(lockname) }
 #endif
 
+/*
+ * SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are 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)
 
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Michael Ellerman

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.

thanks,

Ingo