Commit 6c452a45 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[SCSI] qla2xxx: General checkpatch corrections.

Signed-off-by: default avatarGiridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent bfdaa761
...@@ -1177,15 +1177,13 @@ qla24xx_84xx_fw_version_show(struct device *dev, ...@@ -1177,15 +1177,13 @@ qla24xx_84xx_fw_version_show(struct device *dev,
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (IS_QLA84XX(ha) && ha->cs84xx) { if (IS_QLA84XX(ha) && ha->cs84xx)
if (ha->cs84xx->op_fw_version == 0) { if (ha->cs84xx->op_fw_version == 0)
rval = qla84xx_verify_chip(vha, status); rval = qla84xx_verify_chip(vha, status);
}
if ((rval == QLA_SUCCESS) && (status[0] == 0)) if ((rval == QLA_SUCCESS) && (status[0] == 0))
return snprintf(buf, PAGE_SIZE, "%u\n", return snprintf(buf, PAGE_SIZE, "%u\n",
(uint32_t)ha->cs84xx->op_fw_version); (uint32_t)ha->cs84xx->op_fw_version);
}
return snprintf(buf, PAGE_SIZE, "\n"); return snprintf(buf, PAGE_SIZE, "\n");
} }
......
...@@ -286,6 +286,7 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job) ...@@ -286,6 +286,7 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
rval = -ENOMEM; rval = -ENOMEM;
goto done_free_fcport; goto done_free_fcport;
} }
rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list,
bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE);
if (!rsp_sg_cnt) { if (!rsp_sg_cnt) {
...@@ -294,8 +295,7 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job) ...@@ -294,8 +295,7 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
} }
if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) || if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) ||
(rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) {
{
DEBUG2(printk(KERN_INFO DEBUG2(printk(KERN_INFO
"dma mapping resulted in different sg counts \ "dma mapping resulted in different sg counts \
[request_sg_cnt: %x dma_request_sg_cnt: %x\ [request_sg_cnt: %x dma_request_sg_cnt: %x\
...@@ -388,8 +388,7 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job) ...@@ -388,8 +388,7 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job)
} }
if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) || if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) ||
(rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) {
{
DEBUG2(qla_printk(KERN_WARNING, ha, DEBUG2(qla_printk(KERN_WARNING, ha,
"[request_sg_cnt: %x dma_request_sg_cnt: %x\ "[request_sg_cnt: %x dma_request_sg_cnt: %x\
reply_sg_cnt: %x dma_reply_sg_cnt: %x]\n", reply_sg_cnt: %x dma_reply_sg_cnt: %x]\n",
...@@ -429,8 +428,7 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job) ...@@ -429,8 +428,7 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job)
* no fcport structure allocated * no fcport structure allocated
*/ */
fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL);
if (!fcport) if (!fcport) {
{
rval = -ENOMEM; rval = -ENOMEM;
goto done_unmap_sg; goto done_unmap_sg;
} }
...@@ -492,7 +490,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job) ...@@ -492,7 +490,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
char *type; char *type;
struct msg_echo_lb elreq; struct msg_echo_lb elreq;
uint16_t response[MAILBOX_REGISTER_COUNT]; uint16_t response[MAILBOX_REGISTER_COUNT];
uint8_t* fw_sts_ptr; uint8_t *fw_sts_ptr;
uint8_t *req_data = NULL; uint8_t *req_data = NULL;
dma_addr_t req_data_dma; dma_addr_t req_data_dma;
uint32_t req_data_len; uint32_t req_data_len;
...@@ -524,7 +522,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job) ...@@ -524,7 +522,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
if (!elreq.rsp_sg_cnt) { if (!elreq.rsp_sg_cnt) {
rval = -ENOMEM; rval = -ENOMEM;
goto done_unmap_req_sg; goto done_unmap_req_sg;
} }
if ((elreq.req_sg_cnt != bsg_job->request_payload.sg_cnt) || if ((elreq.req_sg_cnt != bsg_job->request_payload.sg_cnt) ||
(elreq.rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) { (elreq.rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) {
...@@ -586,7 +584,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job) ...@@ -586,7 +584,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
} else { } else {
type = "FC_BSG_HST_VENDOR_ECHO_DIAG"; type = "FC_BSG_HST_VENDOR_ECHO_DIAG";
DEBUG2(qla_printk(KERN_INFO, ha, DEBUG2(qla_printk(KERN_INFO, ha,
"scsi(%ld) bsg rqst type: %s\n" ,vha->host_no, type)); "scsi(%ld) bsg rqst type: %s\n", vha->host_no, type));
command_sent = INT_DEF_LB_ECHO_CMD; command_sent = INT_DEF_LB_ECHO_CMD;
rval = qla2x00_echo_test(vha, &elreq, response); rval = qla2x00_echo_test(vha, &elreq, response);
} }
...@@ -975,7 +973,8 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job) ...@@ -975,7 +973,8 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
bsg_job->reply_payload.payload_len; bsg_job->reply_payload.payload_len;
sg_copy_from_buffer(bsg_job->reply_payload.sg_list, sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
bsg_job->reply_payload.sg_cnt, mgmt_b, data_len); bsg_job->reply_payload.sg_cnt, mgmt_b,
data_len);
} }
} }
...@@ -1062,7 +1061,8 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job) ...@@ -1062,7 +1061,8 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
if (rval) { if (rval) {
DEBUG16(printk(KERN_ERR "scsi(%ld): iIDMA cmd failed for " DEBUG16(printk(KERN_ERR "scsi(%ld): iIDMA cmd failed for "
"%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n", "%02x%02x%02x%02x%02x%02x%02x%02x -- "
"%04x %x %04x %04x.\n",
vha->host_no, fcport->port_name[0], vha->host_no, fcport->port_name[0],
fcport->port_name[1], fcport->port_name[1],
fcport->port_name[2], fcport->port_name[3], fcport->port_name[2], fcport->port_name[3],
...@@ -1164,23 +1164,26 @@ qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job) ...@@ -1164,23 +1164,26 @@ qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
if (!req) if (!req)
continue; continue;
for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++ ) { for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
sp = req->outstanding_cmds[cnt]; sp = req->outstanding_cmds[cnt];
if (sp) { if (sp) {
sp_bsg = (struct srb_bsg*)sp->ctx; sp_bsg = (struct srb_bsg *)sp->ctx;
if (((sp_bsg->ctx.type == SRB_CT_CMD) || if (((sp_bsg->ctx.type == SRB_CT_CMD) ||
(sp_bsg->ctx.type == SRB_ELS_CMD_HST)) (sp_bsg->ctx.type == SRB_ELS_CMD_HST))
&& (sp_bsg->bsg_job == bsg_job)) { && (sp_bsg->bsg_job == bsg_job)) {
if (ha->isp_ops->abort_command(sp)) { if (ha->isp_ops->abort_command(sp)) {
DEBUG2(qla_printk(KERN_INFO, ha, DEBUG2(qla_printk(KERN_INFO, ha,
"scsi(%ld): mbx abort_command failed\n", vha->host_no)); "scsi(%ld): mbx "
"abort_command failed\n",
vha->host_no));
bsg_job->req->errors = bsg_job->req->errors =
bsg_job->reply->result = -EIO; bsg_job->reply->result = -EIO;
} else { } else {
DEBUG2(qla_printk(KERN_INFO, ha, DEBUG2(qla_printk(KERN_INFO, ha,
"scsi(%ld): mbx abort_command success\n", vha->host_no)); "scsi(%ld): mbx "
"abort_command success\n",
vha->host_no));
bsg_job->req->errors = bsg_job->req->errors =
bsg_job->reply->result = 0; bsg_job->reply->result = 0;
} }
......
...@@ -1130,18 +1130,26 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) ...@@ -1130,18 +1130,26 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
qla2x00_sp_compl(ha, sp); qla2x00_sp_compl(ha, sp);
} else { } else {
ctx = sp->ctx; ctx = sp->ctx;
if (ctx->type == SRB_LOGIN_CMD || ctx->type == SRB_LOGOUT_CMD) { if (ctx->type == SRB_LOGIN_CMD ||
ctx->type == SRB_LOGOUT_CMD) {
del_timer_sync(&ctx->timer); del_timer_sync(&ctx->timer);
ctx->free(sp); ctx->free(sp);
} else { } else {
struct srb_bsg* sp_bsg = (struct srb_bsg*)sp->ctx; struct srb_bsg *sp_bsg =
if (sp_bsg->bsg_job->request->msgcode == FC_BSG_HST_CT) (struct srb_bsg *)sp->ctx;
struct fc_bsg_job *bsg_job =
sp_bsg->bsg_job;
if (bsg_job->request->msgcode
== FC_BSG_HST_CT)
kfree(sp->fcport); kfree(sp->fcport);
sp_bsg->bsg_job->req->errors = 0; bsg_job->req->errors = 0;
sp_bsg->bsg_job->reply->result = res; bsg_job->reply->result = res;
sp_bsg->bsg_job->job_done(sp_bsg->bsg_job); bsg_job->job_done(
sp_bsg->bsg_job);
kfree(sp->ctx); kfree(sp->ctx);
mempool_free(sp, ha->srb_mempool); mempool_free(sp,
ha->srb_mempool);
} }
} }
} }
......
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