Commit d1ab824b authored by Michael Ellerman's avatar Michael Ellerman Committed by Linus Torvalds

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: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b5e61818
...@@ -85,6 +85,12 @@ typedef struct { ...@@ -85,6 +85,12 @@ typedef struct {
RW_DEP_MAP_INIT(lockname) } RW_DEP_MAP_INIT(lockname) }
#endif #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 SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init)
#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) #define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment