diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-01-23 09:30:09 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-01-27 06:30:38 -0500 |
commit | d04fa5a3ba06c3b7a1c4a6860d0fa4825507a755 (patch) | |
tree | e17ac53c5bb9b60839d4722533fb0b6ba1c87027 /Documentation/spinlocks.txt | |
parent | 10389a15e25fd4784d42de7e0e3fc8c242f2011d (diff) |
locking: Remove deprecated lock initializers
Last users are gone. Remove the left overs.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'Documentation/spinlocks.txt')
-rw-r--r-- | Documentation/spinlocks.txt | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt index 178c831b907d..2e3c64b1a6a5 100644 --- a/Documentation/spinlocks.txt +++ b/Documentation/spinlocks.txt | |||
@@ -86,7 +86,7 @@ to change the variables it has to get an exclusive write lock. | |||
86 | 86 | ||
87 | The routines look the same as above: | 87 | The routines look the same as above: |
88 | 88 | ||
89 | rwlock_t xxx_lock = RW_LOCK_UNLOCKED; | 89 | rwlock_t xxx_lock = __RW_LOCK_UNLOCKED(xxx_lock); |
90 | 90 | ||
91 | unsigned long flags; | 91 | unsigned long flags; |
92 | 92 | ||
@@ -196,25 +196,3 @@ appropriate: | |||
196 | 196 | ||
197 | For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or | 197 | For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or |
198 | __SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate. | 198 | __SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate. |
199 | |||
200 | SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated. These interfere | ||
201 | with lockdep state tracking. | ||
202 | |||
203 | Most of the time, you can simply turn: | ||
204 | static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED; | ||
205 | into: | ||
206 | static DEFINE_SPINLOCK(xxx_lock); | ||
207 | |||
208 | Static structure member variables go from: | ||
209 | |||
210 | struct foo bar { | ||
211 | .lock = SPIN_LOCK_UNLOCKED; | ||
212 | }; | ||
213 | |||
214 | to: | ||
215 | |||
216 | struct foo bar { | ||
217 | .lock = __SPIN_LOCK_UNLOCKED(bar.lock); | ||
218 | }; | ||
219 | |||
220 | Declaration of static rw_locks undergo a similar transformation. | ||