Skip to content

Commit

Permalink
Document SPIN_LOCK_UNLOCKED/RW_LOCK_UNLOCKED deprecation
Browse files Browse the repository at this point in the history
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 <michael@ellerman.id.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Michael Ellerman authored and Linus Torvalds committed May 8, 2007
1 parent b5e6181 commit d1ab824
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/spinlock_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit d1ab824

Please sign in to comment.