Commit d3ad2bb3 authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley

[SCSI] be2iscsi: Fixing return values

This patch fixes the return values as per comment from Mike Christie
Signed-off-by: default avatarJayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 457ff3b7
...@@ -98,7 +98,7 @@ static int be_mcc_compl_process(struct be_ctrl_info *ctrl, ...@@ -98,7 +98,7 @@ static int be_mcc_compl_process(struct be_ctrl_info *ctrl,
dev_err(&ctrl->pdev->dev, dev_err(&ctrl->pdev->dev,
"error in cmd completion: status(compl/extd)=%d/%d\n", "error in cmd completion: status(compl/extd)=%d/%d\n",
compl_status, extd_status); compl_status, extd_status);
return -1; return -EBUSY;
} }
return 0; return 0;
} }
...@@ -231,7 +231,7 @@ static int be_mcc_wait_compl(struct beiscsi_hba *phba) ...@@ -231,7 +231,7 @@ static int be_mcc_wait_compl(struct beiscsi_hba *phba)
} }
if (i == mcc_timeout) { if (i == mcc_timeout) {
dev_err(&phba->pcidev->dev, "mccq poll timed out\n"); dev_err(&phba->pcidev->dev, "mccq poll timed out\n");
return -1; return -EBUSY;
} }
return 0; return 0;
} }
...@@ -257,7 +257,7 @@ static int be_mbox_db_ready_wait(struct be_ctrl_info *ctrl) ...@@ -257,7 +257,7 @@ static int be_mbox_db_ready_wait(struct be_ctrl_info *ctrl)
if (cnt > 6000000) { if (cnt > 6000000) {
dev_err(&ctrl->pdev->dev, "mbox_db poll timed out\n"); dev_err(&ctrl->pdev->dev, "mbox_db poll timed out\n");
return -1; return -EBUSY;
} }
if (cnt > 50) { if (cnt > 50) {
...@@ -309,7 +309,7 @@ int be_mbox_notify(struct be_ctrl_info *ctrl) ...@@ -309,7 +309,7 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
} }
} else { } else {
dev_err(&ctrl->pdev->dev, "invalid mailbox completion\n"); dev_err(&ctrl->pdev->dev, "invalid mailbox completion\n");
return -1; return -EBUSY;
} }
return 0; return 0;
} }
...@@ -355,7 +355,7 @@ static int be_mbox_notify_wait(struct beiscsi_hba *phba) ...@@ -355,7 +355,7 @@ static int be_mbox_notify_wait(struct beiscsi_hba *phba)
return status; return status;
} else { } else {
dev_err(&phba->pcidev->dev, "invalid mailbox completion\n"); dev_err(&phba->pcidev->dev, "invalid mailbox completion\n");
return -1; return -EBUSY;
} }
return 0; return 0;
} }
...@@ -652,7 +652,7 @@ int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q, ...@@ -652,7 +652,7 @@ int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
default: default:
spin_unlock(&ctrl->mbox_lock); spin_unlock(&ctrl->mbox_lock);
BUG(); BUG();
return -1; return -ENXIO;
} }
be_cmd_hdr_prepare(&req->hdr, subsys, opcode, sizeof(*req)); be_cmd_hdr_prepare(&req->hdr, subsys, opcode, sizeof(*req));
if (queue_type != QTYPE_SGL) if (queue_type != QTYPE_SGL)
......
...@@ -230,7 +230,7 @@ int beiscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, ...@@ -230,7 +230,7 @@ int beiscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
if (!beiscsi_ep) { if (!beiscsi_ep) {
SE_DEBUG(DBG_LVL_1, SE_DEBUG(DBG_LVL_1,
"In beiscsi_conn_get_param , no beiscsi_ep\n"); "In beiscsi_conn_get_param , no beiscsi_ep\n");
return -1; return -ENODEV;
} }
switch (param) { switch (param) {
...@@ -309,7 +309,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost, ...@@ -309,7 +309,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
tag = be_cmd_get_mac_addr(phba); tag = be_cmd_get_mac_addr(phba);
if (!tag) { if (!tag) {
SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed\n"); SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed\n");
return -1; return -EAGAIN;
} else } else
wait_event_interruptible(phba->ctrl.mcc_wait[tag], wait_event_interruptible(phba->ctrl.mcc_wait[tag],
phba->ctrl.mcc_numtag[tag]); phba->ctrl.mcc_numtag[tag]);
...@@ -322,7 +322,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost, ...@@ -322,7 +322,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
" status = %d extd_status = %d\n", " status = %d extd_status = %d\n",
status, extd_status); status, extd_status);
free_mcc_tag(&phba->ctrl, tag); free_mcc_tag(&phba->ctrl, tag);
return -1; return -EAGAIN;
} else { } else {
wrb = queue_get_wrb(mccq, wrb_num); wrb = queue_get_wrb(mccq, wrb_num);
free_mcc_tag(&phba->ctrl, tag); free_mcc_tag(&phba->ctrl, tag);
...@@ -485,7 +485,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, ...@@ -485,7 +485,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
struct tcp_connect_and_offload_out *ptcpcnct_out; struct tcp_connect_and_offload_out *ptcpcnct_out;
unsigned short status, extd_status; unsigned short status, extd_status;
unsigned int tag, wrb_num; unsigned int tag, wrb_num;
int ret = -1; int ret = -ENOMEM;
SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn\n"); SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn\n");
beiscsi_ep->ep_cid = beiscsi_get_cid(phba); beiscsi_ep->ep_cid = beiscsi_get_cid(phba);
...@@ -536,7 +536,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, ...@@ -536,7 +536,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
free_ep: free_ep:
beiscsi_free_ep(beiscsi_ep); beiscsi_free_ep(beiscsi_ep);
return -1; return -EBUSY;
} }
/** /**
...@@ -626,7 +626,7 @@ static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag) ...@@ -626,7 +626,7 @@ static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag)
if (!tag) { if (!tag) {
SE_DEBUG(DBG_LVL_8, "upload failed for cid 0x%x\n", SE_DEBUG(DBG_LVL_8, "upload failed for cid 0x%x\n",
beiscsi_ep->ep_cid); beiscsi_ep->ep_cid);
ret = -1; ret = -EAGAIN;
} else { } else {
wait_event_interruptible(phba->ctrl.mcc_wait[tag], wait_event_interruptible(phba->ctrl.mcc_wait[tag],
phba->ctrl.mcc_numtag[tag]); phba->ctrl.mcc_numtag[tag]);
......
...@@ -2681,7 +2681,7 @@ static int be_queue_alloc(struct beiscsi_hba *phba, struct be_queue_info *q, ...@@ -2681,7 +2681,7 @@ static int be_queue_alloc(struct beiscsi_hba *phba, struct be_queue_info *q,
mem->size = len * entry_size; mem->size = len * entry_size;
mem->va = pci_alloc_consistent(phba->pcidev, mem->size, &mem->dma); mem->va = pci_alloc_consistent(phba->pcidev, mem->size, &mem->dma);
if (!mem->va) if (!mem->va)
return -1; return -ENOMEM;
memset(mem->va, 0, mem->size); memset(mem->va, 0, mem->size);
return 0; return 0;
} }
...@@ -2877,7 +2877,7 @@ static int be_mcc_queues_create(struct beiscsi_hba *phba, ...@@ -2877,7 +2877,7 @@ static int be_mcc_queues_create(struct beiscsi_hba *phba,
mcc_cq_free: mcc_cq_free:
be_queue_free(phba, cq); be_queue_free(phba, cq);
err: err:
return -1; return -ENOMEM;
} }
static int find_num_cpus(void) static int find_num_cpus(void)
......
...@@ -81,7 +81,7 @@ unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl, ...@@ -81,7 +81,7 @@ unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl,
SE_DEBUG(DBG_LVL_1, SE_DEBUG(DBG_LVL_1,
"Failed to allocate memory for mgmt_check_supported_fw" "Failed to allocate memory for mgmt_check_supported_fw"
"\n"); "\n");
return -1; return -ENOMEM;
} }
nonemb_cmd.size = sizeof(struct be_mgmt_controller_attributes); nonemb_cmd.size = sizeof(struct be_mgmt_controller_attributes);
req = nonemb_cmd.va; req = nonemb_cmd.va;
......
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