From: <vl...@us...> - 2008-05-28 11:17:14
|
Revision: 401 http://scst.svn.sourceforge.net/scst/?rev=401&view=rev Author: vlnb Date: 2008-05-28 04:17:08 -0700 (Wed, 28 May 2008) Log Message: ----------- 3 small patches from Bart Van Assche <bar...@gm...>: The patch below fixes the following category of checkpatch complaints: ERROR: do not use C99 // comments This patch has been verified as follows: - Verified that checkpatch does no longer complain about C99 comments. - Verified that make -s clean && make -s iscsi scst && make -s -C srpt still works. Signed-off-by: Bart Van Assche <bar...@gm...> The patch below fixes the following category of checkpatch complaints: WARNING: unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html This patch has been verified as follows: - Verified that checkpatch does no longer complain about unnecessary casts. - Verified that make -s clean && make -s iscsi scst && make -s -C srpt still works and does not trigger any new compiler warnings. Signed-off-by: Bart Van Assche <bar...@gm...> The patch below fixes the following category of checkpatch warnings: ERROR: Use of SPIN_LOCK_UNLOCKED is deprecated: see Documentation/spinlocks.txt This patch has been verified as follows: - Verified that checkpatch does no longer complain about spinlocks. - Verified that make -s clean && make -s iscsi scst && make -s -C srpt still works and does not trigger any new compiler warnings. - Verified that the patch generated by generate-kernel-patch still applies cleanly to the 2.6.25.4 kernel, and that the patched kernel tree still compiles, installs and boots fine, and that the iscsi-scst, ib_srpt, scst_disk and scst_vdisk modules still load. Signed-off-by: Bart Van Assche <bar...@gm...> Modified Paths: -------------- trunk/iscsi-scst/kernel/iscsi.c trunk/iscsi-scst/kernel/nthread.c trunk/qla_isp/linux/isp_scst.c trunk/qla_isp/linux/scsi_target.c trunk/scst/include/scst_debug.h trunk/scst/src/dev_handlers/scst_user.c trunk/scst/src/scst_debug.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_mem.c trunk/scst/src/scst_targ.c Modified: trunk/iscsi-scst/kernel/iscsi.c =================================================================== --- trunk/iscsi-scst/kernel/iscsi.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/iscsi-scst/kernel/iscsi.c 2008-05-28 11:17:08 UTC (rev 401) @@ -42,11 +42,11 @@ 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 @@ 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 @@ 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 @@ break; } - // move this? + /* move this? */ conn->write_size = (conn->write_size + 3) & -4; iscsi_dump_pdu(&cmnd->pdu); } Modified: trunk/iscsi-scst/kernel/nthread.c =================================================================== --- trunk/iscsi-scst/kernel/nthread.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/iscsi-scst/kernel/nthread.c 2008-05-28 11:17:08 UTC (rev 401) @@ -496,7 +496,7 @@ 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 @@ #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) { Modified: trunk/qla_isp/linux/isp_scst.c =================================================================== --- trunk/qla_isp/linux/isp_scst.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/qla_isp/linux/isp_scst.c 2008-05-28 11:17:08 UTC (rev 401) @@ -183,7 +183,7 @@ 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; Modified: trunk/qla_isp/linux/scsi_target.c =================================================================== --- trunk/qla_isp/linux/scsi_target.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/qla_isp/linux/scsi_target.c 2008-05-28 11:17:08 UTC (rev 401) @@ -398,7 +398,7 @@ 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 = { Modified: trunk/scst/include/scst_debug.h =================================================================== --- trunk/scst/include/scst_debug.h 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/scst/include/scst_debug.h 2008-05-28 11:17:08 UTC (rev 401) @@ -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 Modified: trunk/scst/src/dev_handlers/scst_user.c =================================================================== --- trunk/scst/src/dev_handlers/scst_user.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/scst/src/dev_handlers/scst_user.c 2008-05-28 11:17:08 UTC (rev 401) @@ -204,10 +204,10 @@ 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; Modified: trunk/scst/src/scst_debug.c =================================================================== --- trunk/scst/src/scst_debug.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/scst/src/scst_debug.c 2008-05-28 11:17:08 UTC (rev 401) @@ -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) { Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/scst/src/scst_lib.c 2008-05-28 11:17:08 UTC (rev 401) @@ -3185,7 +3185,7 @@ { 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 @@ 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 @@ #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; Modified: trunk/scst/src/scst_mem.c =================================================================== --- trunk/scst/src/scst_mem.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/scst/src/scst_mem.c 2008-05-28 11:17:08 UTC (rev 401) @@ -264,7 +264,7 @@ 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 @@ */ } 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); Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2008-05-27 14:31:31 UTC (rev 400) +++ trunk/scst/src/scst_targ.c 2008-05-28 11:17:08 UTC (rev 401) @@ -3521,7 +3521,7 @@ 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(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |