ia64/xen-unstable

changeset 10165:84dd753a9247

Use DEFINE_SPINLOCK in Linux drivers, conforming to coding style.
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 24 11:56:40 2006 +0100 (2006-05-24)
parents 1345b20cca56
children e336c37b8de0
files linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c linux-2.6-xen-sparse/drivers/xen/console/console.c linux-2.6-xen-sparse/drivers/xen/core/evtchn.c linux-2.6-xen-sparse/drivers/xen/core/gnttab.c linux-2.6-xen-sparse/drivers/xen/netback/netback.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Wed May 24 11:52:25 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Wed May 24 11:56:40 2006 +0100
     1.3 @@ -67,7 +67,7 @@ static DECLARE_MUTEX(balloon_mutex);
     1.4   * Also protects non-atomic updates of current_pages and driver_pages, and
     1.5   * balloon lists.
     1.6   */
     1.7 -spinlock_t balloon_lock = SPIN_LOCK_UNLOCKED;
     1.8 +DEFINE_SPINLOCK(balloon_lock);
     1.9  
    1.10  /* We aim for 'current allocation' == 'target allocation'. */
    1.11  static unsigned long current_pages;
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Wed May 24 11:52:25 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Wed May 24 11:56:40 2006 +0100
     2.3 @@ -82,7 +82,7 @@ typedef struct {
     2.4  
     2.5  static pending_req_t *pending_reqs;
     2.6  static struct list_head pending_free;
     2.7 -static spinlock_t pending_free_lock = SPIN_LOCK_UNLOCKED;
     2.8 +static DEFINE_SPINLOCK(pending_free_lock);
     2.9  static DECLARE_WAIT_QUEUE_HEAD(pending_free_wq);
    2.10  
    2.11  #define BLKBACK_INVALID_HANDLE (~0)
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Wed May 24 11:52:25 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Wed May 24 11:56:40 2006 +0100
     3.3 @@ -93,7 +93,7 @@ static struct block_device_operations xl
     3.4  	.ioctl  = blkif_ioctl,
     3.5  };
     3.6  
     3.7 -spinlock_t blkif_io_lock = SPIN_LOCK_UNLOCKED;
     3.8 +DEFINE_SPINLOCK(blkif_io_lock);
     3.9  
    3.10  static struct xlbd_major_info *
    3.11  xlbd_alloc_major_info(int major, int minor, int index)
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c	Wed May 24 11:52:25 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c	Wed May 24 11:56:40 2006 +0100
     4.3 @@ -138,7 +138,7 @@ typedef struct {
     4.4   */
     4.5  static pending_req_t pending_reqs[MAX_PENDING_REQS];
     4.6  static unsigned char pending_ring[MAX_PENDING_REQS];
     4.7 -static spinlock_t pend_prod_lock = SPIN_LOCK_UNLOCKED;
     4.8 +static DEFINE_SPINLOCK(pend_prod_lock);
     4.9  /* NB. We use a different index type to differentiate from shared blk rings. */
    4.10  typedef unsigned int PEND_RING_IDX;
    4.11  #define MASK_PEND_IDX(_i) ((_i)&(MAX_PENDING_REQS-1))
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed May 24 11:52:25 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed May 24 11:56:40 2006 +0100
     5.3 @@ -124,7 +124,7 @@ static int __init xencons_bufsz_setup(ch
     5.4  __setup("xencons_bufsz=", xencons_bufsz_setup);
     5.5  
     5.6  /* This lock protects accesses to the common transmit buffer. */
     5.7 -static spinlock_t xencons_lock = SPIN_LOCK_UNLOCKED;
     5.8 +static DEFINE_SPINLOCK(xencons_lock);
     5.9  
    5.10  /* Common transmit-kick routine. */
    5.11  static void __xencons_tx_flush(void);
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c	Wed May 24 11:52:25 2006 +0100
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c	Wed May 24 11:56:40 2006 +0100
     6.3 @@ -51,7 +51,7 @@
     6.4   * This lock protects updates to the following mapping and reference-count
     6.5   * arrays. The lock does not need to be acquired to read the mapping tables.
     6.6   */
     6.7 -static spinlock_t irq_mapping_update_lock;
     6.8 +static DEFINE_SPINLOCK(irq_mapping_update_lock);
     6.9  
    6.10  /* IRQ <-> event-channel mappings. */
    6.11  static int evtchn_to_irq[NR_EVENT_CHANNELS];
    6.12 @@ -815,8 +815,6 @@ void __init xen_init_IRQ(void)
    6.13  	int i;
    6.14  	int cpu;
    6.15  
    6.16 -	spin_lock_init(&irq_mapping_update_lock);
    6.17 -
    6.18  	init_evtchn_cpu_bindings();
    6.19  
    6.20  	/* No VIRQ or IPI bindings. */
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c	Wed May 24 11:52:25 2006 +0100
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c	Wed May 24 11:56:40 2006 +0100
     7.3 @@ -81,7 +81,7 @@ EXPORT_SYMBOL_GPL(gnttab_grant_foreign_t
     7.4  static grant_ref_t gnttab_list[NR_GRANT_ENTRIES];
     7.5  static int gnttab_free_count;
     7.6  static grant_ref_t gnttab_free_head;
     7.7 -static spinlock_t gnttab_list_lock = SPIN_LOCK_UNLOCKED;
     7.8 +static DEFINE_SPINLOCK(gnttab_list_lock);
     7.9  
    7.10  static grant_entry_t *shared = NULL;
    7.11  
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed May 24 11:52:25 2006 +0100
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed May 24 11:56:40 2006 +0100
     8.3 @@ -99,7 +99,7 @@ static spinlock_t net_schedule_list_lock
     8.4  #define MAX_MFN_ALLOC 64
     8.5  static unsigned long mfn_list[MAX_MFN_ALLOC];
     8.6  static unsigned int alloc_index = 0;
     8.7 -static spinlock_t mfn_lock = SPIN_LOCK_UNLOCKED;
     8.8 +static DEFINE_SPINLOCK(mfn_lock);
     8.9  
    8.10  static unsigned long alloc_mfn(void)
    8.11  {
    8.12 @@ -691,7 +691,7 @@ static void net_tx_action(unsigned long 
    8.13  
    8.14  static void netif_idx_release(u16 pending_idx)
    8.15  {
    8.16 -	static spinlock_t _lock = SPIN_LOCK_UNLOCKED;
    8.17 +	static DEFINE_SPINLOCK(_lock);
    8.18  	unsigned long flags;
    8.19  
    8.20  	spin_lock_irqsave(&_lock, flags);