locking: Remove the deprecated lock initializers
Subsystems (8)
PATCH 1/9 alpha: Replace deprecated spinlock initialization
In reply to Thomas GleixnerSPIN_LOCK_UNLOCK is deprecated. Use the lockdep capable variant instead.
--- arch/alpha/include/asm/rwsem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/alpha/include/asm/rwsem.h +1 -1
@@ -39,7 +39,7 @@ struct rw_semaphore { };#define __RWSEM_INITIALIZER (name) \ - { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ + { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \ LIST_HEAD_INIT((name).wait_list) }#define DECLARE_RWSEM (name) \
cover locking: Remove the deprecated lock initializers
SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated since lockdep was merged. Fixup the last pertinacious users and remove the initializers.
Thanks,
tglx
PATCH 4/9 sparc: Replace deprecated spinlock initialization
SPIN_LOCK_UNLOCK is deprecated. Use the lockdep capable variant instead.
--- arch/sparc/lib/atomic32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6/arch/sparc/lib/atomic32.c =================================--- linux-2.6.orig/arch/sparc/lib/atomic32.c +++ linux-2.6/arch/sparc/lib/atomic32.c
@@ -16,7 +16,7 @@
#define ATOMIC_HASH(a) (&__atomic_hash[(((unsigned long)a)>>8) & (ATOMIC_HASH_SIZE-1)])
spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
- [0 ... (ATOMIC_HASH_SIZE-1)] = SPIN_LOCK_UNLOCKED
+ [0 ... (ATOMIC_HASH_SIZE-1)] = __SPIN_LOCK_UNLOCKED(__atomic_hash)
};
#else /* SMP */
PATCH 2/9 cris: Replace deprecated spinlock initialization
In reply to Thomas GleixnerSPIN_LOCK_UNLOCK is deprecated. Use the lockdep capable variant instead.
--- arch/cris/arch-v32/kernel/smp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/cris/arch-v32/kernel/smp.c +3 -1
@@ -26,7 +26,9 @@#define FLUSH_ALL (void*)0xffffffff/* Vector of locks used for various atomic operations */ -spinlock_t cris_atomic_locks[] = { [0 ...LOCK_COUNT -1 ] =SPIN_LOCK_UNLOCKED }; +spinlock_t cris_atomic_locks[] = { + [0 ...LOCK_COUNT -1 ] =__SPIN_LOCK_UNLOCKED (cris_atomic_locks) +};/* CPU masks */ cpumask_t phys_cpu_present_map =CPU_MASK_NONE ;
PATCH 3/9 mips: Replace deprecated spinlock initialization
In reply to Thomas GleixnerSPIN_LOCK_UNLOCK is deprecated. Use the lockdep capable variant instead.
--- arch/mips/kernel/vpe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/vpe.c +2 -2
@@ -148,9 +148,9 @@ struct {spinlock_t tc_list_lock;struct list_head tc_list;/* Thread contexts */ } vpecontrol = { - .vpe_list_lock = SPIN_LOCK_UNLOCKED, + .vpe_list_lock = __SPIN_LOCK_UNLOCKED(vpe_list_lock), .vpe_list = LIST_HEAD_INIT(vpecontrol.vpe_list), - .tc_list_lock = SPIN_LOCK_UNLOCKED, + .tc_list_lock = __SPIN_LOCK_UNLOCKED(tc_list_lock), .tc_list =LIST_HEAD_INIT (vpecontrol.tc_list) };
PATCH 6/9 xtensa: Replace deprecated spinlock initialization
In reply to Thomas GleixnerSPIN_LOCK_UNLOCK is deprecated. Use the lockdep capable variant instead.
--- arch/xtensa/include/asm/rwsem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/xtensa/include/asm/rwsem.h +1 -1
@@ -38,7 +38,7 @@ struct rw_semaphore { };#define __RWSEM_INITIALIZER (name) \ - { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ + { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \ LIST_HEAD_INIT((name).wait_list) }#define DECLARE_RWSEM (name) \
PATCH 7/9 kthread: Replace deprecated spinlock initialization
In reply to Thomas GleixnerSPIN_LOCK_UNLOCK is deprecated. Use the lockdep capable variant instead.
--- include/linux/kthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/kthread.h +1 -1
@@ -64,7 +64,7 @@ struct kthread_work { };#define KTHREAD_WORKER_INIT (worker) { \ - .lock = SPIN_LOCK_UNLOCKED, \ + .lock = __SPIN_LOCK_UNLOCKED((worker).lock), \ .work_list = LIST_HEAD_INIT((worker).work_list), \ }
PATCH 5/9 um: Replace deprecated spinlock initialization
In reply to Thomas GleixnerSPIN_LOCK_UNLOCK is deprecated. Use the lockdep capable variant instead.
--- arch/um/drivers/ubd_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/drivers/ubd_kern.c +1 -1
@@ -185,7 +185,7 @@ struct ubd { .no_cow = 0, \ .shared = 0, \ .cow = DEFAULT_COW, \ - .lock = SPIN_LOCK_UNLOCKED, \ + .lock = __SPIN_LOCK_UNLOCKED(ubd_devs.lock), \ .request = NULL, \ .start_sg = 0, \ .end_sg = 0, \
PATCH 8/9 cred: Replace deprecated spinlock initialization
In reply to Thomas GleixnerSPIN_LOCK_UNLOCK is deprecated. Use the lockdep capable variant instead.
--- kernel/cred.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cred.c +1 -1
@@ -35,7 +35,7 @@ static struct kmem_cache *cred_jar;static struct thread_group_cred init_tgcred = { .usage =ATOMIC_INIT (2 ), .tgid =0 , - .lock =SPIN_LOCK_UNLOCKED , + .lock =__SPIN_LOCK_UNLOCKED (init_cred.tgcred.lock), };#endif
PATCH 9/9 locking: Remove deprecated lock initializers
In reply to Thomas GleixnerLast users are gone. Remove the leftovers.
--- Documentation/spinlocks.txt | 24 +----------------------- include/linux/rwlock_types.h | 8 -------- include/linux/spinlock_types.h | 8 -------- scripts/checkpatch.pl | 5 ----- 4 files changed, 1 insertion(+), 44 deletions(-)
Documentation/spinlocks.txt +1 -23
@@ -86,7 +86,7 @@ to change the variables it has to get an The routines look the same as above: - rwlock_t xxx_lock = RW_LOCK_UNLOCKED; + rwlock_t xxx_lock = __RW_LOCK_UNLOCKED(xxx_lock); unsigned long flags;
@@ -196,25 +196,3 @@ appropriate: For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or __SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate. - -SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated. These interfere -with lockdep state tracking. - -Most of the time, you can simply turn: - static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED; -into: - static DEFINE_SPINLOCK(xxx_lock); - -Static structure member variables go from: - - struct foo bar { - .lock = SPIN_LOCK_UNLOCKED; - }; - -to: - - struct foo bar { - .lock = __SPIN_LOCK_UNLOCKED(bar.lock); - }; - -Declaration of static rw_locks undergo a similar transformation.
include/linux/rwlock_types.h +0 -8
@@ -43,14 +43,6 @@ typedef struct { RW_DEP_MAP_INIT(lockname) }#endif -/* -* RW_LOCK_UNLOCKED defeat lockdep state tracking and is hence -* deprecated. -* -* Please use DEFINE_RWLOCK() or __RW_LOCK_UNLOCKED() as appropriate. -*/ -#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) -#define DEFINE_RWLOCK (x) rwlock_t x = __RW_LOCK_UNLOCKED(x)#endif /* __LINUX_RWLOCK_TYPES_H */
include/linux/spinlock_types.h +0 -8
@@ -81,14 +81,6 @@ typedef struct spinlock {#define __SPIN_LOCK_UNLOCKED (lockname) \ (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname) -/* -* SPIN_LOCK_UNLOCKED defeats lockdep state tracking and is hence -* deprecated. -* Please use DEFINE_SPINLOCK() or __SPIN_LOCK_UNLOCKED() as -* appropriate. -*/ -#define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) -#define DEFINE_SPINLOCK (x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)#include <linux/rwlock_types.h>
scripts/checkpatch.pl +0 -5
@@ -2654,11 +2654,6 @@ sub process { WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); } -# SPIN_LOCK_UNLOCKED & RW_LOCK_UNLOCKED are deprecated - if ($line =~ /\b(SPIN_LOCK_UNLOCKED|RW_LOCK_UNLOCKED)/) { - ERROR("Use of $1 is deprecated: see Documentation/spinlocks.txt\n" . $herecurr); - } - # warn about #if 0 if ($line =~ /^.\s*\#\s*if\s+0\b/) { CHK("if this code is redundant consider removing it\n" .
Matt Turner
maintainerRe: [patch 1/9] alpha: Replace deprecated spinlock initialization
In reply to Thomas GleixnerQuoted 16 lines · Thomas Gleixner
SPIN_LOCK_UNLOCKis deprecated. Use the lockdep capable variant instead.Signed-off-by Thomas Gleixner <[email protected]>Cc Richard Henderson <[email protected]>---
arch/alpha/include/asm/rwsem.h | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Index:
linux-2.6/arch/alpha/include/asm/rwsem.h
===================================================================arch/alpha/include/asm/rwsem.h +0
-0@@ -39,7 +39,7 @@ struct rw_semaphore { };
arch/alpha/include/asm/rwsem.h struct rw_semaphore {
Quoted 10 lines
arch/alpha/include/asm/rwsem.h +1
-2#define __RWSEM_INITIALIZER(name) \ - { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ + { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \ LIST_HEAD_INIT((name).wait_list) } #define DECLARE_RWSEM(name) \ --
Thanks! I'll apply this.
Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-alpha" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 4/9] sparc: Replace deprecated spinlock initialization
In reply to Thomas GleixnerFrom: Thomas Gleixner <[email protected]>
Date: Sun, 23 Jan 2011 15:17:04 -0000
Quoted 4 lines
SPIN_LOCK_UNLOCKis deprecated. Use the lockdep capable variant instead.Signed-off-by Thomas Gleixner <[email protected]>
Quoted 2 lines · Thomas Gleixner
SPIN_LOCK_UNLOCKEDandRW_LOCK_UNLOCKEDare deprecated since lockdep was merged. Fixup the last pertinacious users and remove the initializers.
Nice!,
Re: [patch 2/9] cris: Replace deprecated spinlock initialization
In reply to Thomas GleixnerQuoted 6 lines · Thomas Gleixner
SPIN_LOCK_UNLOCKis deprecated. Use the lockdep capable variant instead.Signed-off-by Thomas Gleixner <[email protected]>Cc Mikael Starvik <[email protected]>
Thanks, I'll add this to the CRIS-tree.
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]
Ralf Baechle
AppliedRe: [patch 3/9] mips: Replace deprecated spinlock initialization
In reply to Thomas GleixnerThanks, applied.
Ralf
Re: [patch 1/9] alpha: Replace deprecated spinlock initialization
In reply to Matt TurnerQuoted 3 lines · Matt Turner
On Sun, Jan 23, 2011 at 3:16 PM, Thomas Gleixner <[email protected]> wrote:
Thanks! I'll apply this.
I take it through core/locking in tip as well, because further cleanups depend on it. Git will sort out the identical changes.
Thanks,
tglx
Re: [patch 2/9] cris: Replace deprecated spinlock initialization
In reply to Jesper NilssonQuoted 9 lines · Jesper Nilsson
Quoted 6 lines · Thomas Gleixner
SPIN_LOCK_UNLOCKis deprecated. Use the lockdep capable variant instead.Signed-off-by Thomas Gleixner <[email protected]>Cc Mikael Starvik <[email protected]>Thanks, I'll add this to the CRIS-tree.
I take it through core/locking in tip as well, because further cleanups depend on it. Git will sort out the identical changes.
Thanks,
tglx
Re: [patch 3/9] mips: Replace deprecated spinlock initialization
In reply to Ralf BaechleQuoted 4 lines · Ralf Baechle
Thanks, applied.
Ralf
I take it through core/locking in tip as well, because further cleanups depend on it. Git will sort out the identical changes.
Thanks,
tglx