mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
3 small patches from Bart Van Assche <bart.vanassche@gmail.com>:
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 <bart.vanassche@gmail.com> 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 <bart.vanassche@gmail.com> 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 <bart.vanassche@gmail.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@401 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user