Commit d04fa5a3ba06c3b7a1c4a6860d0fa4825507a755
1 parent
10389a15e2
Exists in
master
and in
20 other branches
locking: Remove deprecated lock initializers
Last users are gone. Remove the left overs. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Showing 4 changed files with 1 additions and 44 deletions Side-by-side Diff
Documentation/spinlocks.txt
... | ... | @@ -86,7 +86,7 @@ |
86 | 86 | |
87 | 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 | 91 | unsigned long flags; |
92 | 92 | |
... | ... | @@ -196,26 +196,4 @@ |
196 | 196 | |
197 | 197 | For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or |
198 | 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. |
include/linux/rwlock_types.h
... | ... | @@ -43,14 +43,6 @@ |
43 | 43 | RW_DEP_MAP_INIT(lockname) } |
44 | 44 | #endif |
45 | 45 | |
46 | -/* | |
47 | - * RW_LOCK_UNLOCKED defeat lockdep state tracking and is hence | |
48 | - * deprecated. | |
49 | - * | |
50 | - * Please use DEFINE_RWLOCK() or __RW_LOCK_UNLOCKED() as appropriate. | |
51 | - */ | |
52 | -#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) | |
53 | - | |
54 | 46 | #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) |
55 | 47 | |
56 | 48 | #endif /* __LINUX_RWLOCK_TYPES_H */ |
include/linux/spinlock_types.h
... | ... | @@ -81,14 +81,6 @@ |
81 | 81 | #define __SPIN_LOCK_UNLOCKED(lockname) \ |
82 | 82 | (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname) |
83 | 83 | |
84 | -/* | |
85 | - * SPIN_LOCK_UNLOCKED defeats lockdep state tracking and is hence | |
86 | - * deprecated. | |
87 | - * Please use DEFINE_SPINLOCK() or __SPIN_LOCK_UNLOCKED() as | |
88 | - * appropriate. | |
89 | - */ | |
90 | -#define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) | |
91 | - | |
92 | 84 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) |
93 | 85 | |
94 | 86 | #include <linux/rwlock_types.h> |
scripts/checkpatch.pl
... | ... | @@ -2654,11 +2654,6 @@ |
2654 | 2654 | WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); |
2655 | 2655 | } |
2656 | 2656 | |
2657 | -# SPIN_LOCK_UNLOCKED & RW_LOCK_UNLOCKED are deprecated | |
2658 | - if ($line =~ /\b(SPIN_LOCK_UNLOCKED|RW_LOCK_UNLOCKED)/) { | |
2659 | - ERROR("Use of $1 is deprecated: see Documentation/spinlocks.txt\n" . $herecurr); | |
2660 | - } | |
2661 | - | |
2662 | 2657 | # warn about #if 0 |
2663 | 2658 | if ($line =~ /^.\s*\#\s*if\s+0\b/) { |
2664 | 2659 | CHK("if this code is redundant consider removing it\n" . |