Mailing List Archive

Use DEFINE_SPINLOCK in Linux drivers, conforming to coding style.
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID 84dd753a9247293b985304073da7963d3b3d1a32
# Parent 1345b20cca565950c0209971a0a71d19498cc765
Use DEFINE_SPINLOCK in Linux drivers, conforming to coding style.
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c | 2 +-
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c | 2 +-
linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c | 2 +-
linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c | 2 +-
linux-2.6-xen-sparse/drivers/xen/console/console.c | 2 +-
linux-2.6-xen-sparse/drivers/xen/core/evtchn.c | 4 +---
linux-2.6-xen-sparse/drivers/xen/core/gnttab.c | 2 +-
linux-2.6-xen-sparse/drivers/xen/netback/netback.c | 4 ++--
8 files changed, 9 insertions(+), 11 deletions(-)

diff -r 1345b20cca56 -r 84dd753a9247 linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c Wed May 24 11:52:25 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c Wed May 24 11:56:40 2006 +0100
@@ -67,7 +67,7 @@ static DECLARE_MUTEX(balloon_mutex);
* Also protects non-atomic updates of current_pages and driver_pages, and
* balloon lists.
*/
-spinlock_t balloon_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(balloon_lock);

/* We aim for 'current allocation' == 'target allocation'. */
static unsigned long current_pages;
diff -r 1345b20cca56 -r 84dd753a9247 linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Wed May 24 11:52:25 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Wed May 24 11:56:40 2006 +0100
@@ -82,7 +82,7 @@ typedef struct {

static pending_req_t *pending_reqs;
static struct list_head pending_free;
-static spinlock_t pending_free_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pending_free_lock);
static DECLARE_WAIT_QUEUE_HEAD(pending_free_wq);

#define BLKBACK_INVALID_HANDLE (~0)
diff -r 1345b20cca56 -r 84dd753a9247 linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed May 24 11:52:25 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed May 24 11:56:40 2006 +0100
@@ -93,7 +93,7 @@ static struct block_device_operations xl
.ioctl = blkif_ioctl,
};

-spinlock_t blkif_io_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(blkif_io_lock);

static struct xlbd_major_info *
xlbd_alloc_major_info(int major, int minor, int index)
diff -r 1345b20cca56 -r 84dd753a9247 linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c
--- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c Wed May 24 11:52:25 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c Wed May 24 11:56:40 2006 +0100
@@ -138,7 +138,7 @@ typedef struct {
*/
static pending_req_t pending_reqs[MAX_PENDING_REQS];
static unsigned char pending_ring[MAX_PENDING_REQS];
-static spinlock_t pend_prod_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pend_prod_lock);
/* NB. We use a different index type to differentiate from shared blk rings. */
typedef unsigned int PEND_RING_IDX;
#define MASK_PEND_IDX(_i) ((_i)&(MAX_PENDING_REQS-1))
diff -r 1345b20cca56 -r 84dd753a9247 linux-2.6-xen-sparse/drivers/xen/console/console.c
--- a/linux-2.6-xen-sparse/drivers/xen/console/console.c Wed May 24 11:52:25 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c Wed May 24 11:56:40 2006 +0100
@@ -124,7 +124,7 @@ __setup("xencons_bufsz=", xencons_bufsz_
__setup("xencons_bufsz=", xencons_bufsz_setup);

/* This lock protects accesses to the common transmit buffer. */
-static spinlock_t xencons_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xencons_lock);

/* Common transmit-kick routine. */
static void __xencons_tx_flush(void);
diff -r 1345b20cca56 -r 84dd753a9247 linux-2.6-xen-sparse/drivers/xen/core/evtchn.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c Wed May 24 11:52:25 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c Wed May 24 11:56:40 2006 +0100
@@ -51,7 +51,7 @@
* This lock protects updates to the following mapping and reference-count
* arrays. The lock does not need to be acquired to read the mapping tables.
*/
-static spinlock_t irq_mapping_update_lock;
+static DEFINE_SPINLOCK(irq_mapping_update_lock);

/* IRQ <-> event-channel mappings. */
static int evtchn_to_irq[NR_EVENT_CHANNELS];
@@ -815,8 +815,6 @@ void __init xen_init_IRQ(void)
int i;
int cpu;

- spin_lock_init(&irq_mapping_update_lock);
-
init_evtchn_cpu_bindings();

/* No VIRQ or IPI bindings. */
diff -r 1345b20cca56 -r 84dd753a9247 linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c Wed May 24 11:52:25 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c Wed May 24 11:56:40 2006 +0100
@@ -81,7 +81,7 @@ static grant_ref_t gnttab_list[NR_GRANT_
static grant_ref_t gnttab_list[NR_GRANT_ENTRIES];
static int gnttab_free_count;
static grant_ref_t gnttab_free_head;
-static spinlock_t gnttab_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(gnttab_list_lock);

static grant_entry_t *shared = NULL;

diff -r 1345b20cca56 -r 84dd753a9247 linux-2.6-xen-sparse/drivers/xen/netback/netback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Wed May 24 11:52:25 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Wed May 24 11:56:40 2006 +0100
@@ -99,7 +99,7 @@ static spinlock_t net_schedule_list_lock
#define MAX_MFN_ALLOC 64
static unsigned long mfn_list[MAX_MFN_ALLOC];
static unsigned int alloc_index = 0;
-static spinlock_t mfn_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(mfn_lock);

static unsigned long alloc_mfn(void)
{
@@ -691,7 +691,7 @@ static void net_tx_action(unsigned long

static void netif_idx_release(u16 pending_idx)
{
- static spinlock_t _lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(_lock);
unsigned long flags;

spin_lock_irqsave(&_lock, flags);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog