Commit b8207c12 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds

[PATCH] Lock initializer cleanup: SCSI

Use the new lock initializers DEFINE_SPIN_LOCK and DEFINE_RW_LOCK
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 243bb4dd
...@@ -167,7 +167,7 @@ struct aha1542_hostdata { ...@@ -167,7 +167,7 @@ struct aha1542_hostdata {
static struct Scsi_Host *aha_host[7]; /* One for each IRQ level (9-15) */ static struct Scsi_Host *aha_host[7]; /* One for each IRQ level (9-15) */
static spinlock_t aha1542_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(aha1542_lock);
......
...@@ -145,7 +145,7 @@ struct adpt_i2o_post_wait_data ...@@ -145,7 +145,7 @@ struct adpt_i2o_post_wait_data
static struct adpt_i2o_post_wait_data *adpt_post_wait_queue = NULL; static struct adpt_i2o_post_wait_data *adpt_post_wait_queue = NULL;
static u32 adpt_post_wait_id = 0; static u32 adpt_post_wait_id = 0;
static spinlock_t adpt_post_wait_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(adpt_post_wait_lock);
/*============================================================================ /*============================================================================
......
...@@ -839,7 +839,7 @@ struct hostdata { ...@@ -839,7 +839,7 @@ struct hostdata {
static struct Scsi_Host *sh[MAX_BOARDS]; static struct Scsi_Host *sh[MAX_BOARDS];
static const char *driver_name = "EATA"; static const char *driver_name = "EATA";
static char sha[MAX_BOARDS]; static char sha[MAX_BOARDS];
static spinlock_t driver_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(driver_lock);
/* Initialize num_boards so that ihdlr can work while detect is in progress */ /* Initialize num_boards so that ihdlr can work while detect is in progress */
static unsigned int num_boards = MAX_BOARDS; static unsigned int num_boards = MAX_BOARDS;
......
...@@ -185,7 +185,7 @@ enum { ...@@ -185,7 +185,7 @@ enum {
/* The master ring of all esp hosts we are managing in this driver. */ /* The master ring of all esp hosts we are managing in this driver. */
static struct esp *espchain; static struct esp *espchain;
static spinlock_t espchain_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(espchain_lock);
static int esps_running = 0; static int esps_running = 0;
/* Forward declarations. */ /* Forward declarations. */
......
...@@ -60,7 +60,7 @@ static inline imm_struct *imm_dev(struct Scsi_Host *host) ...@@ -60,7 +60,7 @@ static inline imm_struct *imm_dev(struct Scsi_Host *host)
return *(imm_struct **)&host->hostdata; return *(imm_struct **)&host->hostdata;
} }
static spinlock_t arbitration_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(arbitration_lock);
static void got_it(imm_struct *dev) static void got_it(imm_struct *dev)
{ {
......
...@@ -89,7 +89,7 @@ static struct list_head ipr_ioa_head = LIST_HEAD_INIT(ipr_ioa_head); ...@@ -89,7 +89,7 @@ static struct list_head ipr_ioa_head = LIST_HEAD_INIT(ipr_ioa_head);
static unsigned int ipr_log_level = IPR_DEFAULT_LOG_LEVEL; static unsigned int ipr_log_level = IPR_DEFAULT_LOG_LEVEL;
static unsigned int ipr_max_speed = 1; static unsigned int ipr_max_speed = 1;
static int ipr_testmode = 0; static int ipr_testmode = 0;
static spinlock_t ipr_driver_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(ipr_driver_lock);
/* This table describes the differences between DMA controller chips */ /* This table describes the differences between DMA controller chips */
static const struct ipr_chip_cfg_t ipr_chip_cfg[] = { static const struct ipr_chip_cfg_t ipr_chip_cfg[] = {
......
...@@ -150,7 +150,7 @@ static int osst_max_dev = OSST_MAX_TAPES; ...@@ -150,7 +150,7 @@ static int osst_max_dev = OSST_MAX_TAPES;
static int osst_nr_dev; static int osst_nr_dev;
static struct osst_tape **os_scsi_tapes = NULL; static struct osst_tape **os_scsi_tapes = NULL;
static rwlock_t os_scsi_tapes_lock = RW_LOCK_UNLOCKED; static DEFINE_RWLOCK(os_scsi_tapes_lock);
static int modes_defined = FALSE; static int modes_defined = FALSE;
......
...@@ -49,7 +49,7 @@ static inline ppa_struct *ppa_dev(struct Scsi_Host *host) ...@@ -49,7 +49,7 @@ static inline ppa_struct *ppa_dev(struct Scsi_Host *host)
return *(ppa_struct **)&host->hostdata; return *(ppa_struct **)&host->hostdata;
} }
static spinlock_t arbitration_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(arbitration_lock);
static void got_it(ppa_struct *dev) static void got_it(ppa_struct *dev)
{ {
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include "qlogicpti_asm.c" #include "qlogicpti_asm.c"
static struct qlogicpti *qptichain = NULL; static struct qlogicpti *qptichain = NULL;
static spinlock_t qptichain_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(qptichain_lock);
static int qptis_running = 0; static int qptis_running = 0;
#define PACKB(a, b) (((a)<<4)|(b)) #define PACKB(a, b) (((a)<<4)|(b))
......
...@@ -925,7 +925,7 @@ EXPORT_SYMBOL(scsi_finish_command); ...@@ -925,7 +925,7 @@ EXPORT_SYMBOL(scsi_finish_command);
*/ */
void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags) void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags)
{ {
static spinlock_t device_request_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(device_request_lock);
unsigned long flags; unsigned long flags;
/* /*
......
...@@ -169,7 +169,7 @@ struct sdebug_host_info { ...@@ -169,7 +169,7 @@ struct sdebug_host_info {
container_of(d, struct sdebug_host_info, dev) container_of(d, struct sdebug_host_info, dev)
static LIST_HEAD(sdebug_host_list); static LIST_HEAD(sdebug_host_list);
static spinlock_t sdebug_host_list_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(sdebug_host_list_lock);
typedef void (* done_funct_t) (struct scsi_cmnd *); typedef void (* done_funct_t) (struct scsi_cmnd *);
...@@ -213,8 +213,8 @@ static int num_dev_resets = 0; ...@@ -213,8 +213,8 @@ static int num_dev_resets = 0;
static int num_bus_resets = 0; static int num_bus_resets = 0;
static int num_host_resets = 0; static int num_host_resets = 0;
static spinlock_t queued_arr_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(queued_arr_lock);
static rwlock_t atomic_rw = RW_LOCK_UNLOCKED; static DEFINE_RWLOCK(atomic_rw);
static char sdebug_proc_name[] = "scsi_debug"; static char sdebug_proc_name[] = "scsi_debug";
......
...@@ -105,7 +105,7 @@ struct scsi_disk { ...@@ -105,7 +105,7 @@ struct scsi_disk {
}; };
static DEFINE_IDR(sd_index_idr); static DEFINE_IDR(sd_index_idr);
static spinlock_t sd_index_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(sd_index_lock);
/* This semaphore is used to mediate the 0->1 reference get in the /* This semaphore is used to mediate the 0->1 reference get in the
* face of object destruction (i.e. we can't allow a get on an * face of object destruction (i.e. we can't allow a get on an
......
...@@ -108,7 +108,7 @@ static void sg_remove(struct class_device *); ...@@ -108,7 +108,7 @@ static void sg_remove(struct class_device *);
static Scsi_Request *dummy_cmdp; /* only used for sizeof */ static Scsi_Request *dummy_cmdp; /* only used for sizeof */
static rwlock_t sg_dev_arr_lock = RW_LOCK_UNLOCKED; /* Also used to lock static DEFINE_RWLOCK(sg_dev_arr_lock); /* Also used to lock
file descriptor list for device */ file descriptor list for device */
static struct class_interface sg_interface = { static struct class_interface sg_interface = {
......
...@@ -85,7 +85,7 @@ static struct scsi_driver sr_template = { ...@@ -85,7 +85,7 @@ static struct scsi_driver sr_template = {
}; };
static unsigned long sr_index_bits[SR_DISKS / BITS_PER_LONG]; static unsigned long sr_index_bits[SR_DISKS / BITS_PER_LONG];
static spinlock_t sr_index_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(sr_index_lock);
/* This semaphore is used to mediate the 0->1 reference get in the /* This semaphore is used to mediate the 0->1 reference get in the
* face of object destruction (i.e. we can't allow a get on an * face of object destruction (i.e. we can't allow a get on an
......
...@@ -167,7 +167,7 @@ DEB( static int debugging = DEBUG; ) ...@@ -167,7 +167,7 @@ DEB( static int debugging = DEBUG; )
24 bits) */ 24 bits) */
#define SET_DENS_AND_BLK 0x10001 #define SET_DENS_AND_BLK 0x10001
static rwlock_t st_dev_arr_lock = RW_LOCK_UNLOCKED; static DEFINE_RWLOCK(st_dev_arr_lock);
static int st_fixed_buffer_size = ST_FIXED_BUFFER_SIZE; static int st_fixed_buffer_size = ST_FIXED_BUFFER_SIZE;
static int st_max_sg_segs = ST_MAX_SG; static int st_max_sg_segs = ST_MAX_SG;
......
...@@ -239,7 +239,7 @@ static void sym53c416_set_transfer_counter(int base, unsigned int len) ...@@ -239,7 +239,7 @@ static void sym53c416_set_transfer_counter(int base, unsigned int len)
outb((len & 0xFF0000) >> 16, base + TC_HIGH); outb((len & 0xFF0000) >> 16, base + TC_HIGH);
} }
static spinlock_t sym53c416_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(sym53c416_lock);
/* Returns the number of bytes read */ /* Returns the number of bytes read */
static __inline__ unsigned int sym53c416_read(int base, unsigned char *buffer, unsigned int len) static __inline__ unsigned int sym53c416_read(int base, unsigned char *buffer, unsigned int len)
......
...@@ -156,7 +156,7 @@ pci_get_base_address(struct pci_dev *pdev, int index, u_long *base) ...@@ -156,7 +156,7 @@ pci_get_base_address(struct pci_dev *pdev, int index, u_long *base)
} }
/* This lock protects only the memory allocation/free. */ /* This lock protects only the memory allocation/free. */
static spinlock_t sym53c8xx_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(sym53c8xx_lock);
static struct scsi_transport_template *sym2_transport_template = NULL; static struct scsi_transport_template *sym2_transport_template = NULL;
......
...@@ -250,7 +250,7 @@ static void ___m_free(m_pool_s *mp, void *ptr, int size) ...@@ -250,7 +250,7 @@ static void ___m_free(m_pool_s *mp, void *ptr, int size)
} }
} }
static spinlock_t ncr53c8xx_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(ncr53c8xx_lock);
static void *__m_calloc2(m_pool_s *mp, int size, char *name, int uflags) static void *__m_calloc2(m_pool_s *mp, int size, char *name, int uflags)
{ {
......
...@@ -612,7 +612,7 @@ struct hostdata { ...@@ -612,7 +612,7 @@ struct hostdata {
static struct Scsi_Host *sh[MAX_BOARDS + 1]; static struct Scsi_Host *sh[MAX_BOARDS + 1];
static const char *driver_name = "Ux4F"; static const char *driver_name = "Ux4F";
static char sha[MAX_BOARDS]; static char sha[MAX_BOARDS];
static spinlock_t driver_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(driver_lock);
/* Initialize num_boards so that ihdlr can work while detect is in progress */ /* Initialize num_boards so that ihdlr can work while detect is in progress */
static unsigned int num_boards = MAX_BOARDS; static unsigned int num_boards = MAX_BOARDS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment