Sparse cleanups

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1713 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2010-05-24 12:32:45 +00:00
parent 2436e1bb8b
commit bc1cda46df
6 changed files with 9 additions and 11 deletions

View File

@@ -975,9 +975,9 @@ static int create_reject_rsp(struct iscsi_cmnd *req, int reason, bool get_data)
if (cmnd_opcode(req) == ISCSI_OP_SCSI_CMD) {
if (req->scst_cmd == NULL) {
/* BUSY status must be already set */
struct iscsi_scsi_rsp_hdr *rsp_hdr;
rsp_hdr = (struct iscsi_scsi_rsp_hdr *)&req->main_rsp->pdu.bhs;
sBUG_ON(rsp_hdr->cmd_status == 0);
struct iscsi_scsi_rsp_hdr *rsp_hdr1;
rsp_hdr1 = (struct iscsi_scsi_rsp_hdr *)&req->main_rsp->pdu.bhs;
sBUG_ON(rsp_hdr1->cmd_status == 0);
/*
* Let's not send REJECT here. The initiator will retry
* and, hopefully, next time we will not fail allocating

View File

@@ -1140,7 +1140,6 @@ static inline void __iscsi_put_page_callback(struct iscsi_cmnd *cmd) {}
void req_add_to_write_timeout_list(struct iscsi_cmnd *req)
{
struct iscsi_conn *conn;
unsigned long timeout_time;
bool set_conn_tm_active = false;
TRACE_ENTRY();
@@ -1168,6 +1167,7 @@ void req_add_to_write_timeout_list(struct iscsi_cmnd *req)
&conn->write_timeout_list);
if (!timer_pending(&conn->rsp_timer)) {
unsigned long timeout_time;
if (unlikely(conn->conn_tm_active ||
test_bit(ISCSI_CMD_ABORTED,
&req->prelim_compl_flags))) {

View File

@@ -175,9 +175,9 @@ int __add_session(struct iscsi_target *target,
*/
list_for_each_entry_reverse(sess, &target->session_list,
session_list_entry) {
union iscsi_sid i = *(union iscsi_sid *)&sess->sid;
i.id.tsih = 0;
if ((sid.id64 == i.id64) &&
union iscsi_sid s = *(union iscsi_sid *)&sess->sid;
s.id.tsih = 0;
if ((sid.id64 == s.id64) &&
(strcmp(info->initiator_name, sess->initiator_name) == 0)) {
if (!sess->sess_shutting_down) {
/* session reinstatement */

View File

@@ -119,7 +119,7 @@ int __add_target(struct iscsi_kern_target_info *info)
{
int err;
u32 tid = info->tid;
struct iscsi_target *target;
struct iscsi_target *target = NULL; /* to calm down sparse */
struct iscsi_kern_params_info *params_info;
struct iscsi_kern_attr *attr_info;
union add_info_union {

View File

@@ -2493,7 +2493,7 @@ restart:
* Probably that's wrong, but sometimes write() returns
* value less, than requested. Let's restart.
*/
int i, e = eiv_count;
int e = eiv_count;
TRACE_MGMT_DBG("write() returned %d from %zd "
"(iv_count=%d)", (int)err, full_len,
eiv_count);

View File

@@ -1445,8 +1445,6 @@ int scst_add_threads(struct scst_cmd_threads *cmd_threads,
}
for (i = 0; i < num; i++) {
struct scst_cmd_thread_t *thr;
thr = kmalloc(sizeof(*thr), GFP_KERNEL);
if (!thr) {
res = -ENOMEM;