diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index b381bc616..41783266a 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -42,11 +42,11 @@ unsigned long iscsi_trace_flag = ISCSI_DEFAULT_LOG_FLAGS; static struct kmem_cache *iscsi_cmnd_cache; -spinlock_t iscsi_rd_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(iscsi_rd_lock); LIST_HEAD(iscsi_rd_list); DECLARE_WAIT_QUEUE_HEAD(iscsi_rd_waitQ); -spinlock_t iscsi_wr_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(iscsi_wr_lock); LIST_HEAD(iscsi_wr_list); DECLARE_WAIT_QUEUE_HEAD(iscsi_wr_waitQ); @@ -700,7 +700,7 @@ static struct iscsi_cmnd *create_sense_rsp(struct iscsi_cmnd *req, memset(sense, 0, sizeof(sense)); sense[0] = 0xf0; sense[2] = sense_key; - sense[7] = 6; // Additional sense length + sense[7] = 6; /* Additional sense length */ sense[12] = asc; sense[13] = ascq; return create_status_rsp(req, SAM_STAT_CHECK_CONDITION, sense, @@ -784,7 +784,7 @@ static void __update_stat_sn(struct iscsi_cmnd *cmnd) TRACE_DBG("%x,%x", cmnd_opcode(cmnd), exp_stat_sn); if ((int)(exp_stat_sn - conn->exp_stat_sn) > 0 && (int)(exp_stat_sn - conn->stat_sn) <= 0) { - // free pdu resources + /* free pdu resources */ cmnd->conn->exp_stat_sn = exp_stat_sn; } } @@ -2139,7 +2139,7 @@ void cmnd_tx_start(struct iscsi_cmnd *cmnd) break; } - // move this? + /* move this? */ conn->write_size = (conn->write_size + 3) & -4; iscsi_dump_pdu(&cmnd->pdu); } diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index 3a5e8e1e8..9bd5e4077 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -496,7 +496,7 @@ static void start_close_conn(struct iscsi_conn *conn) static inline void iscsi_conn_init_read(struct iscsi_conn *conn, void *data, size_t len) { - len = (len + 3) & -4; // XXX ??? + len = (len + 3) & -4; /* XXX ??? */ conn->read_iov[0].iov_base = data; conn->read_iov[0].iov_len = len; conn->read_msg.msg_iov = conn->read_iov; @@ -1059,7 +1059,7 @@ static int write_data(struct iscsi_conn *conn) #ifdef NET_PAGE_CALLBACKS_DEFINED { - static spinlock_t net_priv_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(net_priv_lock); spin_lock(&net_priv_lock); if (sg_page(&sg[idx])->net_priv != NULL) { if (sg_page(&sg[idx])->net_priv != ref_cmd) { diff --git a/qla_isp/linux/isp_scst.c b/qla_isp/linux/isp_scst.c index ffb721653..29f8e7dbe 100644 --- a/qla_isp/linux/isp_scst.c +++ b/qla_isp/linux/isp_scst.c @@ -183,7 +183,7 @@ static void bus_chan_unregister_sessions(bus_chan_t *bc, int wait); static bus_t busses[MAX_BUS]; -static spinlock_t scsi_target_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(scsi_target_lock); DECLARE_WAIT_QUEUE_HEAD(qlaispd_waitq); struct task_struct *qlaispd_task; diff --git a/qla_isp/linux/scsi_target.c b/qla_isp/linux/scsi_target.c index e27bceba9..fad4f2138 100644 --- a/qla_isp/linux/scsi_target.c +++ b/qla_isp/linux/scsi_target.c @@ -398,7 +398,7 @@ DECLARE_MUTEX_LOCKED(scsi_thread_entry_exit_semaphore); static tmd_cmd_t *p_front = NULL, *p_last = NULL; static tmd_cmd_t *q_front = NULL, *q_last = NULL; static tmd_cmd_t *r_front = NULL, *r_last = NULL; -static spinlock_t scsi_target_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(scsi_target_lock); static int scsi_target_thread_exit = 0; static struct file_operations scsi_target_fops = { diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index a84b24548..e7d91a612 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -91,7 +91,7 @@ #endif #ifdef DEBUG -//# define LOG_FLAG KERN_DEBUG +/*# define LOG_FLAG KERN_DEBUG*/ # define LOG_FLAG KERN_INFO # define INFO_FLAG KERN_INFO # define ERROR_FLAG KERN_INFO diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index 114b91e75..75ca162bb 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -204,10 +204,10 @@ static struct file_operations dev_user_fops = { static struct class *dev_user_sysfs_class; -static spinlock_t dev_list_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(dev_list_lock); static LIST_HEAD(dev_list); -static spinlock_t cleanup_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cleanup_lock); static LIST_HEAD(cleanup_list); static DECLARE_WAIT_QUEUE_HEAD(cleanup_list_waitQ); static struct task_struct *cleanup_thread; diff --git a/scst/src/scst_debug.c b/scst/src/scst_debug.c index fec1762b6..dba045eef 100644 --- a/scst/src/scst_debug.c +++ b/scst/src/scst_debug.c @@ -26,7 +26,7 @@ #define TRACE_BUF_SIZE 512 static char trace_buf[TRACE_BUF_SIZE]; -static spinlock_t trace_buf_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(trace_buf_lock); static inline int get_current_tid(void) { diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 24c04828d..c4ffba875 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -3185,7 +3185,7 @@ unsigned long scst_random(void) { static int Inited; static unsigned long RandomValue; - static spinlock_t lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(lock); /* cycles pseudo-randomly through all values between 1 and 2^31 - 2 */ register long rv; register long lo; @@ -3220,7 +3220,7 @@ EXPORT_SYMBOL(scst_random); static void tm_dbg_timer_fn(unsigned long arg); -static spinlock_t scst_tm_dbg_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(scst_tm_dbg_lock); /* All serialized by scst_tm_dbg_lock */ struct { unsigned int tm_dbg_release:1; @@ -3504,7 +3504,7 @@ int tm_dbg_is_release(void) #ifdef DEBUG_SN void scst_check_debug_sn(struct scst_cmd *cmd) { - static spinlock_t lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(lock); static int type; static int cnt; unsigned long flags; diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index 22b8a6605..879b2dcc0 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -264,7 +264,7 @@ static int sgv_alloc_arrays(struct sgv_pool_obj *obj, sz = pages_to_alloc * sizeof(obj->sg_entries[0]); - obj->sg_entries = (struct scatterlist *)kmalloc(sz, gfp_mask); + obj->sg_entries = kmalloc(sz, gfp_mask); if (unlikely(obj->sg_entries == NULL)) { TRACE(TRACE_OUT_OF_MEM, "Allocation of sgv_pool_obj " "SG vector failed (size %d)", sz); @@ -283,7 +283,7 @@ static int sgv_alloc_arrays(struct sgv_pool_obj *obj, */ } else { tsz = pages_to_alloc * sizeof(obj->trans_tbl[0]); - obj->trans_tbl = (struct trans_tbl_ent *)kzalloc(tsz, gfp_mask); + obj->trans_tbl = kzalloc(tsz, gfp_mask); if (unlikely(obj->trans_tbl == NULL)) { TRACE(TRACE_OUT_OF_MEM, "Allocation of trans_tbl " "failed (size %d)", tsz); diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index b9e04c111..c176a784f 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -3521,7 +3521,7 @@ void scst_abort_cmd(struct scst_cmd *cmd, struct scst_mgmt_cmd *mcmd, int other_ini, int call_dev_task_mgmt_fn) { unsigned long flags; - static spinlock_t other_ini_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(other_ini_lock); TRACE_ENTRY();