
From: <tglx@linutronix.de>

To make spinlock/rwlock initialization consistent all over the kernel,
this patch converts explicit lock-initializers into spin_lock_init() and
rwlock_init() calls.

Currently, spinlocks and rwlocks are initialized in two different ways:

  lock = SPIN_LOCK_UNLOCKED
  spin_lock_init(&lock)
  
  rwlock = RW_LOCK_UNLOCKED
  rwlock_init(&rwlock)

this patch converts all explicit lock initializations to
spin_lock_init() or rwlock_init(). (Besides consistency this also helps
automatic lock validators and debugging code.)

The conversion was done with a script, it was verified manually and it
was reviewed, compiled and tested as far as possible on x86, ARM, PPC.

There is no runtime overhead or actual code change resulting out of this
patch, because spin_lock_init() and rwlock_init() are macros and are
thus equivalent to the explicit initialization method.

That's the second batch of the unifying patches.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/alpha/kernel/core_marvel.c |    2 +-
 25-akpm/arch/alpha/kernel/srmcons.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN arch/alpha/kernel/core_marvel.c~lock-initializer-unifying-batch-2-alpha arch/alpha/kernel/core_marvel.c
--- 25/arch/alpha/kernel/core_marvel.c~lock-initializer-unifying-batch-2-alpha	Thu Oct 28 15:51:53 2004
+++ 25-akpm/arch/alpha/kernel/core_marvel.c	Thu Oct 28 15:51:53 2004
@@ -118,7 +118,7 @@ alloc_io7(unsigned int pe)
 
 	io7 = alloc_bootmem(sizeof(*io7));
 	io7->pe = pe;
-	io7->irq_lock = SPIN_LOCK_UNLOCKED;
+	spin_lock_init(&io7->irq_lock);
 
 	for (h = 0; h < 4; h++) {
 		io7->ports[h].io7 = io7;
diff -puN arch/alpha/kernel/srmcons.c~lock-initializer-unifying-batch-2-alpha arch/alpha/kernel/srmcons.c
--- 25/arch/alpha/kernel/srmcons.c~lock-initializer-unifying-batch-2-alpha	Thu Oct 28 15:51:53 2004
+++ 25-akpm/arch/alpha/kernel/srmcons.c	Thu Oct 28 15:51:53 2004
@@ -179,7 +179,7 @@ srmcons_get_private_struct(struct srmcon
 		}
 
 		srmconsp->tty = NULL;
-		srmconsp->lock = SPIN_LOCK_UNLOCKED;
+		spin_lock_init(&srmconsp->lock);
 		init_timer(&srmconsp->timer);
 
 		*ps = srmconsp;
_
