[patch 16/16] locking: Remove old style lock initializers

Thomas Gleixner
2009-11-06T22:42:44Z

[-- Attachment #1: locking-remove-oldstyle-lock-initializers.patch --]
[-- Type: text/plain, Size: 1797 bytes --]

SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED have been deprecated for
years. Now the last users are gone. Remove the cruft.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/spinlock.h | 4 ++--
include/linux/spinlock_types.h | 9 ---------
2 files changed, 2 insertions(+), 11 deletions(-)

Index: linux-2.6/include/linux/spinlock.h
===================================================================
--- linux-2.6.orig/include/linux/spinlock.h
+++ linux-2.6/include/linux/spinlock.h
@@ -102,7 +102,7 @@ do { \

#else
# define spin_lock_init(lock) \
- do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0)
+ do { *(lock) = __SPIN_LOCK_UNLOCKED(lock); } while (0)
#endif

#ifdef CONFIG_DEBUG_SPINLOCK
@@ -116,7 +116,7 @@ do { \
} while (0)
#else
# define rwlock_init(lock) \
- do { *(lock) = RW_LOCK_UNLOCKED; } while (0)
+ do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0)
#endif

#define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock)
Index: linux-2.6/include/linux/spinlock_types.h
===================================================================
--- linux-2.6.orig/include/linux/spinlock_types.h
+++ linux-2.6/include/linux/spinlock_types.h
@@ -85,15 +85,6 @@ 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)
-
#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
#define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x)