
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/drivers/bluetooth/bfusb.c   |    2 +-
 25-akpm/drivers/bluetooth/hci_usb.c |    2 +-
 25-akpm/net/bluetooth/l2cap.c       |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/bluetooth/bfusb.c~lock-initializer-unifying-batch-2-bluetooth drivers/bluetooth/bfusb.c
--- 25/drivers/bluetooth/bfusb.c~lock-initializer-unifying-batch-2-bluetooth	2004-11-03 20:26:34.357405576 -0800
+++ 25-akpm/drivers/bluetooth/bfusb.c	2004-11-03 20:26:34.363404664 -0800
@@ -680,7 +680,7 @@ static int bfusb_probe(struct usb_interf
 	bfusb->bulk_out_ep   = bulk_out_ep->desc.bEndpointAddress;
 	bfusb->bulk_pkt_size = bulk_out_ep->desc.wMaxPacketSize;
 
-	bfusb->lock = RW_LOCK_UNLOCKED;
+	rwlock_init(&bfusb->lock);
 
 	bfusb->reassembly = NULL;
 
diff -puN drivers/bluetooth/hci_usb.c~lock-initializer-unifying-batch-2-bluetooth drivers/bluetooth/hci_usb.c
--- 25/drivers/bluetooth/hci_usb.c~lock-initializer-unifying-batch-2-bluetooth	2004-11-03 20:26:34.358405424 -0800
+++ 25-akpm/drivers/bluetooth/hci_usb.c	2004-11-03 20:26:34.364404512 -0800
@@ -933,7 +933,7 @@ int hci_usb_probe(struct usb_interface *
 	}
 #endif
 
-	husb->completion_lock = RW_LOCK_UNLOCKED;
+	rwlock_init(&husb->completion_lock);
 
 	for (i = 0; i < 4; i++) {
 		skb_queue_head_init(&husb->transmit_q[i]);
diff -puN net/bluetooth/l2cap.c~lock-initializer-unifying-batch-2-bluetooth net/bluetooth/l2cap.c
--- 25/net/bluetooth/l2cap.c~lock-initializer-unifying-batch-2-bluetooth	2004-11-03 20:26:34.360405120 -0800
+++ 25-akpm/net/bluetooth/l2cap.c	2004-11-03 20:26:34.365404360 -0800
@@ -134,7 +134,7 @@ static struct l2cap_conn *l2cap_conn_add
 	conn->dst = &hcon->dst;
 
 	spin_lock_init(&conn->lock);
-	conn->chan_list.lock = RW_LOCK_UNLOCKED;
+	rwlock_init(&conn->chan_list.lock);
 
 	BT_DBG("hcon %p conn %p", hcon, conn);
 	return conn;
_
