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 | |
parent | 10389a15e25fd4784d42de7e0e3fc8c242f2011d (diff) |
locking: Remove deprecated lock initializers
Last users are gone. Remove the left overs.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | Documentation/spinlocks.txt | 24 | ||||
-rw-r--r-- | include/linux/rwlock_types.h | 8 | ||||
-rw-r--r-- | include/linux/spinlock_types.h | 8 | ||||
-rwxr-xr-x | scripts/checkpatch.pl | 5 |
4 files changed, 1 insertions, 44 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. | ||
diff --git a/include/linux/rwlock_types.h b/include/linux/rwlock_types.h index bd31808c7d8e..cc0072e93e36 100644 --- a/include/linux/rwlock_types.h +++ b/include/linux/rwlock_types.h | |||
@@ -43,14 +43,6 @@ typedef struct { | |||
43 | RW_DEP_MAP_INIT(lockname) } | 43 | RW_DEP_MAP_INIT(lockname) } |
44 | #endif | 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 | #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) | 46 | #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) |
55 | 47 | ||
56 | #endif /* __LINUX_RWLOCK_TYPES_H */ | 48 | #endif /* __LINUX_RWLOCK_TYPES_H */ |
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h index 851b7783720d..73548eb13a5d 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h | |||
@@ -81,14 +81,6 @@ typedef struct spinlock { | |||
81 | #define __SPIN_LOCK_UNLOCKED(lockname) \ | 81 | #define __SPIN_LOCK_UNLOCKED(lockname) \ |
82 | (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname) | 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 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | 84 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) |
93 | 85 | ||
94 | #include <linux/rwlock_types.h> | 86 | #include <linux/rwlock_types.h> |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4c0383da1c9a..58848e3e392c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2654,11 +2654,6 @@ sub process { | |||
2654 | WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); | 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 | # warn about #if 0 | 2657 | # warn about #if 0 |
2663 | if ($line =~ /^.\s*\#\s*if\s+0\b/) { | 2658 | if ($line =~ /^.\s*\#\s*if\s+0\b/) { |
2664 | CHK("if this code is redundant consider removing it\n" . | 2659 | CHK("if this code is redundant consider removing it\n" . |