aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorSebastian Herbszt <herbszt@gmx.de>2015-08-31 16:48:14 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-10-26 21:06:00 -0400
commitdb6f1c2f900b536d23de386dc7f2a53aa80d7307 (patch)
treea8f7712c2f9cdcb8f616ec2f17c9fc6dfe650a77 /drivers/scsi/lpfc
parent3bb11fc5d0584adc075ddc6b42abdfb2ee776e9d (diff)
lpfc: remove set but not used variables
Remove set but not used variables. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c6
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c20
-rw-r--r--drivers/scsi/lpfc/lpfc_ct.c5
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c56
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c11
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c4
-rw-r--r--drivers/scsi/lpfc/lpfc_mbox.c8
-rw-r--r--drivers/scsi/lpfc/lpfc_nportdisc.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c14
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c8
10 files changed, 8 insertions, 126 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index d65bd178d131..3c6cc9d11e83 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -1642,8 +1642,6 @@ lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \
1642 struct Scsi_Host *shost = class_to_shost(dev);\ 1642 struct Scsi_Host *shost = class_to_shost(dev);\
1643 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ 1643 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
1644 struct lpfc_hba *phba = vport->phba;\ 1644 struct lpfc_hba *phba = vport->phba;\
1645 uint val = 0;\
1646 val = phba->cfg_##attr;\
1647 return snprintf(buf, PAGE_SIZE, "%d\n",\ 1645 return snprintf(buf, PAGE_SIZE, "%d\n",\
1648 phba->cfg_##attr);\ 1646 phba->cfg_##attr);\
1649} 1647}
@@ -1808,8 +1806,6 @@ lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \
1808{ \ 1806{ \
1809 struct Scsi_Host *shost = class_to_shost(dev);\ 1807 struct Scsi_Host *shost = class_to_shost(dev);\
1810 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ 1808 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
1811 uint val = 0;\
1812 val = vport->cfg_##attr;\
1813 return snprintf(buf, PAGE_SIZE, "%d\n", vport->cfg_##attr);\ 1809 return snprintf(buf, PAGE_SIZE, "%d\n", vport->cfg_##attr);\
1814} 1810}
1815 1811
@@ -1835,8 +1831,6 @@ lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \
1835{ \ 1831{ \
1836 struct Scsi_Host *shost = class_to_shost(dev);\ 1832 struct Scsi_Host *shost = class_to_shost(dev);\
1837 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\ 1833 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
1838 uint val = 0;\
1839 val = vport->cfg_##attr;\
1840 return snprintf(buf, PAGE_SIZE, "%#x\n", vport->cfg_##attr);\ 1834 return snprintf(buf, PAGE_SIZE, "%#x\n", vport->cfg_##attr);\
1841} 1835}
1842 1836
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index b705068079c0..05dcc2abd541 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -904,7 +904,6 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
904{ 904{
905 uint32_t evt_req_id = 0; 905 uint32_t evt_req_id = 0;
906 uint32_t cmd; 906 uint32_t cmd;
907 uint32_t len;
908 struct lpfc_dmabuf *dmabuf = NULL; 907 struct lpfc_dmabuf *dmabuf = NULL;
909 struct lpfc_bsg_event *evt; 908 struct lpfc_bsg_event *evt;
910 struct event_data *evt_dat = NULL; 909 struct event_data *evt_dat = NULL;
@@ -946,7 +945,6 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
946 ct_req = (struct lpfc_sli_ct_request *)dmabuf->virt; 945 ct_req = (struct lpfc_sli_ct_request *)dmabuf->virt;
947 evt_req_id = ct_req->FsType; 946 evt_req_id = ct_req->FsType;
948 cmd = ct_req->CommandResponse.bits.CmdRsp; 947 cmd = ct_req->CommandResponse.bits.CmdRsp;
949 len = ct_req->CommandResponse.bits.Size;
950 if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED)) 948 if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED))
951 lpfc_sli_ringpostbuf_put(phba, pring, dmabuf); 949 lpfc_sli_ringpostbuf_put(phba, pring, dmabuf);
952 950
@@ -2988,7 +2986,6 @@ lpfc_bsg_diag_loopback_run(struct fc_bsg_job *job)
2988{ 2986{
2989 struct lpfc_vport *vport = (struct lpfc_vport *)job->shost->hostdata; 2987 struct lpfc_vport *vport = (struct lpfc_vport *)job->shost->hostdata;
2990 struct lpfc_hba *phba = vport->phba; 2988 struct lpfc_hba *phba = vport->phba;
2991 struct diag_mode_test *diag_mode;
2992 struct lpfc_bsg_event *evt; 2989 struct lpfc_bsg_event *evt;
2993 struct event_data *evdat; 2990 struct event_data *evdat;
2994 struct lpfc_sli *psli = &phba->sli; 2991 struct lpfc_sli *psli = &phba->sli;
@@ -3031,8 +3028,6 @@ lpfc_bsg_diag_loopback_run(struct fc_bsg_job *job)
3031 rc = -EINVAL; 3028 rc = -EINVAL;
3032 goto loopback_test_exit; 3029 goto loopback_test_exit;
3033 } 3030 }
3034 diag_mode = (struct diag_mode_test *)
3035 job->request->rqst_data.h_vendor.vendor_cmd;
3036 3031
3037 if ((phba->link_state == LPFC_HBA_ERROR) || 3032 if ((phba->link_state == LPFC_HBA_ERROR) ||
3038 (psli->sli_flag & LPFC_BLOCK_MGMT_IO) || 3033 (psli->sli_flag & LPFC_BLOCK_MGMT_IO) ||
@@ -3293,7 +3288,6 @@ lpfc_bsg_get_dfc_rev(struct fc_bsg_job *job)
3293{ 3288{
3294 struct lpfc_vport *vport = (struct lpfc_vport *)job->shost->hostdata; 3289 struct lpfc_vport *vport = (struct lpfc_vport *)job->shost->hostdata;
3295 struct lpfc_hba *phba = vport->phba; 3290 struct lpfc_hba *phba = vport->phba;
3296 struct get_mgmt_rev *event_req;
3297 struct get_mgmt_rev_reply *event_reply; 3291 struct get_mgmt_rev_reply *event_reply;
3298 int rc = 0; 3292 int rc = 0;
3299 3293
@@ -3306,9 +3300,6 @@ lpfc_bsg_get_dfc_rev(struct fc_bsg_job *job)
3306 goto job_error; 3300 goto job_error;
3307 } 3301 }
3308 3302
3309 event_req = (struct get_mgmt_rev *)
3310 job->request->rqst_data.h_vendor.vendor_cmd;
3311
3312 event_reply = (struct get_mgmt_rev_reply *) 3303 event_reply = (struct get_mgmt_rev_reply *)
3313 job->reply->reply_data.vendor_reply.vendor_rsp; 3304 job->reply->reply_data.vendor_reply.vendor_rsp;
3314 3305
@@ -4348,7 +4339,6 @@ static int
4348lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct fc_bsg_job *job, 4339lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct fc_bsg_job *job,
4349 struct lpfc_dmabuf *dmabuf) 4340 struct lpfc_dmabuf *dmabuf)
4350{ 4341{
4351 struct lpfc_sli_config_mbox *sli_cfg_mbx;
4352 struct bsg_job_data *dd_data = NULL; 4342 struct bsg_job_data *dd_data = NULL;
4353 LPFC_MBOXQ_t *pmboxq = NULL; 4343 LPFC_MBOXQ_t *pmboxq = NULL;
4354 MAILBOX_t *pmb; 4344 MAILBOX_t *pmb;
@@ -4362,9 +4352,6 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct fc_bsg_job *job,
4362 phba->mbox_ext_buf_ctx.seqNum++; 4352 phba->mbox_ext_buf_ctx.seqNum++;
4363 nemb_tp = phba->mbox_ext_buf_ctx.nembType; 4353 nemb_tp = phba->mbox_ext_buf_ctx.nembType;
4364 4354
4365 sli_cfg_mbx = (struct lpfc_sli_config_mbox *)
4366 phba->mbox_ext_buf_ctx.mbx_dmabuf->virt;
4367
4368 dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); 4355 dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL);
4369 if (!dd_data) { 4356 if (!dd_data) {
4370 rc = -ENOMEM; 4357 rc = -ENOMEM;
@@ -4606,7 +4593,6 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job,
4606 uint32_t transmit_length, receive_length, mode; 4593 uint32_t transmit_length, receive_length, mode;
4607 struct lpfc_mbx_sli4_config *sli4_config; 4594 struct lpfc_mbx_sli4_config *sli4_config;
4608 struct lpfc_mbx_nembed_cmd *nembed_sge; 4595 struct lpfc_mbx_nembed_cmd *nembed_sge;
4609 struct mbox_header *header;
4610 struct ulp_bde64 *bde; 4596 struct ulp_bde64 *bde;
4611 uint8_t *ext = NULL; 4597 uint8_t *ext = NULL;
4612 int rc = 0; 4598 int rc = 0;
@@ -4804,8 +4790,6 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job,
4804 /* rebuild the command for sli4 using our 4790 /* rebuild the command for sli4 using our
4805 * own buffers like we do for biu diags 4791 * own buffers like we do for biu diags
4806 */ 4792 */
4807 header = (struct mbox_header *)
4808 &pmb->un.varWords[0];
4809 nembed_sge = (struct lpfc_mbx_nembed_cmd *) 4793 nembed_sge = (struct lpfc_mbx_nembed_cmd *)
4810 &pmb->un.varWords[0]; 4794 &pmb->un.varWords[0];
4811 receive_length = nembed_sge->sge[0].length; 4795 receive_length = nembed_sge->sge[0].length;
@@ -5048,7 +5032,6 @@ lpfc_menlo_cmd(struct fc_bsg_job *job)
5048 IOCB_t *cmd; 5032 IOCB_t *cmd;
5049 int rc = 0; 5033 int rc = 0;
5050 struct menlo_command *menlo_cmd; 5034 struct menlo_command *menlo_cmd;
5051 struct menlo_response *menlo_resp;
5052 struct lpfc_dmabuf *bmp = NULL, *cmp = NULL, *rmp = NULL; 5035 struct lpfc_dmabuf *bmp = NULL, *cmp = NULL, *rmp = NULL;
5053 int request_nseg; 5036 int request_nseg;
5054 int reply_nseg; 5037 int reply_nseg;
@@ -5088,9 +5071,6 @@ lpfc_menlo_cmd(struct fc_bsg_job *job)
5088 menlo_cmd = (struct menlo_command *) 5071 menlo_cmd = (struct menlo_command *)
5089 job->request->rqst_data.h_vendor.vendor_cmd; 5072 job->request->rqst_data.h_vendor.vendor_cmd;
5090 5073
5091 menlo_resp = (struct menlo_response *)
5092 job->reply->reply_data.vendor_reply.vendor_rsp;
5093
5094 /* allocate our bsg tracking structure */ 5074 /* allocate our bsg tracking structure */
5095 dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL); 5075 dd_data = kmalloc(sizeof(struct bsg_job_data), GFP_KERNEL);
5096 if (!dd_data) { 5076 if (!dd_data) {
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index af129966bd11..aaf1cd747c9b 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -575,7 +575,6 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
575 struct lpfc_vport *vport = cmdiocb->vport; 575 struct lpfc_vport *vport = cmdiocb->vport;
576 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 576 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
577 IOCB_t *irsp; 577 IOCB_t *irsp;
578 struct lpfc_dmabuf *bmp;
579 struct lpfc_dmabuf *outp; 578 struct lpfc_dmabuf *outp;
580 struct lpfc_sli_ct_request *CTrsp; 579 struct lpfc_sli_ct_request *CTrsp;
581 struct lpfc_nodelist *ndlp; 580 struct lpfc_nodelist *ndlp;
@@ -588,7 +587,6 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
588 cmdiocb->context_un.rsp_iocb = rspiocb; 587 cmdiocb->context_un.rsp_iocb = rspiocb;
589 588
590 outp = (struct lpfc_dmabuf *) cmdiocb->context2; 589 outp = (struct lpfc_dmabuf *) cmdiocb->context2;
591 bmp = (struct lpfc_dmabuf *) cmdiocb->context3;
592 irsp = &rspiocb->iocb; 590 irsp = &rspiocb->iocb;
593 591
594 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT, 592 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT,
@@ -1733,12 +1731,9 @@ hba_out:
1733 case SLI_MGMT_RPRT: 1731 case SLI_MGMT_RPRT:
1734 case SLI_MGMT_RPA: 1732 case SLI_MGMT_RPA:
1735 { 1733 {
1736 lpfc_vpd_t *vp;
1737 struct serv_parm *hsp; 1734 struct serv_parm *hsp;
1738 int len = 0; 1735 int len = 0;
1739 1736
1740 vp = &phba->vpd;
1741
1742 if (cmdcode == SLI_MGMT_RPRT) { 1737 if (cmdcode == SLI_MGMT_RPRT) {
1743 rh = (struct lpfc_fdmi_reg_hba *) 1738 rh = (struct lpfc_fdmi_reg_hba *)
1744 &CtReq->un.PortID; 1739 &CtReq->un.PortID;
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 36bf58ba750a..c859aa3c0f9a 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -457,11 +457,9 @@ lpfc_issue_reg_vfi(struct lpfc_vport *vport)
457 struct lpfc_hba *phba = vport->phba; 457 struct lpfc_hba *phba = vport->phba;
458 LPFC_MBOXQ_t *mboxq; 458 LPFC_MBOXQ_t *mboxq;
459 struct lpfc_nodelist *ndlp; 459 struct lpfc_nodelist *ndlp;
460 struct serv_parm *sp;
461 struct lpfc_dmabuf *dmabuf; 460 struct lpfc_dmabuf *dmabuf;
462 int rc = 0; 461 int rc = 0;
463 462
464 sp = &phba->fc_fabparam;
465 /* move forward in case of SLI4 FC port loopback test and pt2pt mode */ 463 /* move forward in case of SLI4 FC port loopback test and pt2pt mode */
466 if ((phba->sli_rev == LPFC_SLI_REV4) && 464 if ((phba->sli_rev == LPFC_SLI_REV4) &&
467 !(phba->link_flag & LS_LOOPBACK_MODE) && 465 !(phba->link_flag & LS_LOOPBACK_MODE) &&
@@ -1205,14 +1203,11 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1205 struct serv_parm *sp; 1203 struct serv_parm *sp;
1206 IOCB_t *icmd; 1204 IOCB_t *icmd;
1207 struct lpfc_iocbq *elsiocb; 1205 struct lpfc_iocbq *elsiocb;
1208 struct lpfc_sli_ring *pring;
1209 uint8_t *pcmd; 1206 uint8_t *pcmd;
1210 uint16_t cmdsize; 1207 uint16_t cmdsize;
1211 uint32_t tmo; 1208 uint32_t tmo;
1212 int rc; 1209 int rc;
1213 1210
1214 pring = &phba->sli.ring[LPFC_ELS_RING];
1215
1216 cmdsize = (sizeof(uint32_t) + sizeof(struct serv_parm)); 1211 cmdsize = (sizeof(uint32_t) + sizeof(struct serv_parm));
1217 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, 1212 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp,
1218 ndlp->nlp_DID, ELS_CMD_FLOGI); 1213 ndlp->nlp_DID, ELS_CMD_FLOGI);
@@ -1454,8 +1449,6 @@ lpfc_initial_fdisc(struct lpfc_vport *vport)
1454void 1449void
1455lpfc_more_plogi(struct lpfc_vport *vport) 1450lpfc_more_plogi(struct lpfc_vport *vport)
1456{ 1451{
1457 int sentplogi;
1458
1459 if (vport->num_disc_nodes) 1452 if (vport->num_disc_nodes)
1460 vport->num_disc_nodes--; 1453 vport->num_disc_nodes--;
1461 1454
@@ -1468,7 +1461,7 @@ lpfc_more_plogi(struct lpfc_vport *vport)
1468 /* Check to see if there are more PLOGIs to be sent */ 1461 /* Check to see if there are more PLOGIs to be sent */
1469 if (vport->fc_flag & FC_NLP_MORE) 1462 if (vport->fc_flag & FC_NLP_MORE)
1470 /* go thru NPR nodes and issue any remaining ELS PLOGIs */ 1463 /* go thru NPR nodes and issue any remaining ELS PLOGIs */
1471 sentplogi = lpfc_els_disc_plogi(vport); 1464 lpfc_els_disc_plogi(vport);
1472 1465
1473 return; 1466 return;
1474} 1467}
@@ -1956,16 +1949,12 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry)
1956{ 1949{
1957 struct lpfc_hba *phba = vport->phba; 1950 struct lpfc_hba *phba = vport->phba;
1958 struct serv_parm *sp; 1951 struct serv_parm *sp;
1959 IOCB_t *icmd;
1960 struct lpfc_nodelist *ndlp; 1952 struct lpfc_nodelist *ndlp;
1961 struct lpfc_iocbq *elsiocb; 1953 struct lpfc_iocbq *elsiocb;
1962 struct lpfc_sli *psli;
1963 uint8_t *pcmd; 1954 uint8_t *pcmd;
1964 uint16_t cmdsize; 1955 uint16_t cmdsize;
1965 int ret; 1956 int ret;
1966 1957
1967 psli = &phba->sli;
1968
1969 ndlp = lpfc_findnode_did(vport, did); 1958 ndlp = lpfc_findnode_did(vport, did);
1970 if (ndlp && !NLP_CHK_NODE_ACT(ndlp)) 1959 if (ndlp && !NLP_CHK_NODE_ACT(ndlp))
1971 ndlp = NULL; 1960 ndlp = NULL;
@@ -1977,7 +1966,6 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry)
1977 if (!elsiocb) 1966 if (!elsiocb)
1978 return 1; 1967 return 1;
1979 1968
1980 icmd = &elsiocb->iocb;
1981 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 1969 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
1982 1970
1983 /* For PLOGI request, remainder of payload is service parameters */ 1971 /* For PLOGI request, remainder of payload is service parameters */
@@ -2034,10 +2022,8 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2034 struct lpfc_vport *vport = cmdiocb->vport; 2022 struct lpfc_vport *vport = cmdiocb->vport;
2035 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2023 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2036 IOCB_t *irsp; 2024 IOCB_t *irsp;
2037 struct lpfc_sli *psli;
2038 struct lpfc_nodelist *ndlp; 2025 struct lpfc_nodelist *ndlp;
2039 2026
2040 psli = &phba->sli;
2041 /* we pass cmdiocb to state machine which needs rspiocb as well */ 2027 /* we pass cmdiocb to state machine which needs rspiocb as well */
2042 cmdiocb->context_un.rsp_iocb = rspiocb; 2028 cmdiocb->context_un.rsp_iocb = rspiocb;
2043 2029
@@ -2117,7 +2103,6 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2117 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2103 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2118 struct lpfc_hba *phba = vport->phba; 2104 struct lpfc_hba *phba = vport->phba;
2119 PRLI *npr; 2105 PRLI *npr;
2120 IOCB_t *icmd;
2121 struct lpfc_iocbq *elsiocb; 2106 struct lpfc_iocbq *elsiocb;
2122 uint8_t *pcmd; 2107 uint8_t *pcmd;
2123 uint16_t cmdsize; 2108 uint16_t cmdsize;
@@ -2128,7 +2113,6 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2128 if (!elsiocb) 2113 if (!elsiocb)
2129 return 1; 2114 return 1;
2130 2115
2131 icmd = &elsiocb->iocb;
2132 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 2116 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
2133 2117
2134 /* For PRLI request, remainder of payload is service parameters */ 2118 /* For PRLI request, remainder of payload is service parameters */
@@ -2413,7 +2397,6 @@ lpfc_issue_els_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2413 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2397 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2414 struct lpfc_hba *phba = vport->phba; 2398 struct lpfc_hba *phba = vport->phba;
2415 ADISC *ap; 2399 ADISC *ap;
2416 IOCB_t *icmd;
2417 struct lpfc_iocbq *elsiocb; 2400 struct lpfc_iocbq *elsiocb;
2418 uint8_t *pcmd; 2401 uint8_t *pcmd;
2419 uint16_t cmdsize; 2402 uint16_t cmdsize;
@@ -2424,7 +2407,6 @@ lpfc_issue_els_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2424 if (!elsiocb) 2407 if (!elsiocb)
2425 return 1; 2408 return 1;
2426 2409
2427 icmd = &elsiocb->iocb;
2428 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 2410 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
2429 2411
2430 /* For ADISC request, remainder of payload is service parameters */ 2412 /* For ADISC request, remainder of payload is service parameters */
@@ -2478,12 +2460,10 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2478 struct lpfc_vport *vport = ndlp->vport; 2460 struct lpfc_vport *vport = ndlp->vport;
2479 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2461 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2480 IOCB_t *irsp; 2462 IOCB_t *irsp;
2481 struct lpfc_sli *psli;
2482 struct lpfcMboxq *mbox; 2463 struct lpfcMboxq *mbox;
2483 unsigned long flags; 2464 unsigned long flags;
2484 uint32_t skip_recovery = 0; 2465 uint32_t skip_recovery = 0;
2485 2466
2486 psli = &phba->sli;
2487 /* we pass cmdiocb to state machine which needs rspiocb as well */ 2467 /* we pass cmdiocb to state machine which needs rspiocb as well */
2488 cmdiocb->context_un.rsp_iocb = rspiocb; 2468 cmdiocb->context_un.rsp_iocb = rspiocb;
2489 2469
@@ -2609,7 +2589,6 @@ lpfc_issue_els_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2609{ 2589{
2610 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2590 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2611 struct lpfc_hba *phba = vport->phba; 2591 struct lpfc_hba *phba = vport->phba;
2612 IOCB_t *icmd;
2613 struct lpfc_iocbq *elsiocb; 2592 struct lpfc_iocbq *elsiocb;
2614 uint8_t *pcmd; 2593 uint8_t *pcmd;
2615 uint16_t cmdsize; 2594 uint16_t cmdsize;
@@ -2628,7 +2607,6 @@ lpfc_issue_els_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2628 if (!elsiocb) 2607 if (!elsiocb)
2629 return 1; 2608 return 1;
2630 2609
2631 icmd = &elsiocb->iocb;
2632 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 2610 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
2633 *((uint32_t *) (pcmd)) = ELS_CMD_LOGO; 2611 *((uint32_t *) (pcmd)) = ELS_CMD_LOGO;
2634 pcmd += sizeof(uint32_t); 2612 pcmd += sizeof(uint32_t);
@@ -2742,14 +2720,11 @@ int
2742lpfc_issue_els_scr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry) 2720lpfc_issue_els_scr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2743{ 2721{
2744 struct lpfc_hba *phba = vport->phba; 2722 struct lpfc_hba *phba = vport->phba;
2745 IOCB_t *icmd;
2746 struct lpfc_iocbq *elsiocb; 2723 struct lpfc_iocbq *elsiocb;
2747 struct lpfc_sli *psli;
2748 uint8_t *pcmd; 2724 uint8_t *pcmd;
2749 uint16_t cmdsize; 2725 uint16_t cmdsize;
2750 struct lpfc_nodelist *ndlp; 2726 struct lpfc_nodelist *ndlp;
2751 2727
2752 psli = &phba->sli;
2753 cmdsize = (sizeof(uint32_t) + sizeof(SCR)); 2728 cmdsize = (sizeof(uint32_t) + sizeof(SCR));
2754 2729
2755 ndlp = lpfc_findnode_did(vport, nportid); 2730 ndlp = lpfc_findnode_did(vport, nportid);
@@ -2776,7 +2751,6 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2776 return 1; 2751 return 1;
2777 } 2752 }
2778 2753
2779 icmd = &elsiocb->iocb;
2780 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 2754 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
2781 2755
2782 *((uint32_t *) (pcmd)) = ELS_CMD_SCR; 2756 *((uint32_t *) (pcmd)) = ELS_CMD_SCR;
@@ -2836,9 +2810,7 @@ static int
2836lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry) 2810lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2837{ 2811{
2838 struct lpfc_hba *phba = vport->phba; 2812 struct lpfc_hba *phba = vport->phba;
2839 IOCB_t *icmd;
2840 struct lpfc_iocbq *elsiocb; 2813 struct lpfc_iocbq *elsiocb;
2841 struct lpfc_sli *psli;
2842 FARP *fp; 2814 FARP *fp;
2843 uint8_t *pcmd; 2815 uint8_t *pcmd;
2844 uint32_t *lp; 2816 uint32_t *lp;
@@ -2846,7 +2818,6 @@ lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2846 struct lpfc_nodelist *ondlp; 2818 struct lpfc_nodelist *ondlp;
2847 struct lpfc_nodelist *ndlp; 2819 struct lpfc_nodelist *ndlp;
2848 2820
2849 psli = &phba->sli;
2850 cmdsize = (sizeof(uint32_t) + sizeof(FARP)); 2821 cmdsize = (sizeof(uint32_t) + sizeof(FARP));
2851 2822
2852 ndlp = lpfc_findnode_did(vport, nportid); 2823 ndlp = lpfc_findnode_did(vport, nportid);
@@ -2872,7 +2843,6 @@ lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2872 return 1; 2843 return 1;
2873 } 2844 }
2874 2845
2875 icmd = &elsiocb->iocb;
2876 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 2846 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
2877 2847
2878 *((uint32_t *) (pcmd)) = ELS_CMD_FARPR; 2848 *((uint32_t *) (pcmd)) = ELS_CMD_FARPR;
@@ -3922,13 +3892,11 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
3922 IOCB_t *icmd; 3892 IOCB_t *icmd;
3923 IOCB_t *oldcmd; 3893 IOCB_t *oldcmd;
3924 struct lpfc_iocbq *elsiocb; 3894 struct lpfc_iocbq *elsiocb;
3925 struct lpfc_sli *psli;
3926 uint8_t *pcmd; 3895 uint8_t *pcmd;
3927 uint16_t cmdsize; 3896 uint16_t cmdsize;
3928 int rc; 3897 int rc;
3929 ELS_PKT *els_pkt_ptr; 3898 ELS_PKT *els_pkt_ptr;
3930 3899
3931 psli = &phba->sli;
3932 oldcmd = &oldiocb->iocb; 3900 oldcmd = &oldiocb->iocb;
3933 3901
3934 switch (flag) { 3902 switch (flag) {
@@ -4061,12 +4029,10 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
4061 IOCB_t *icmd; 4029 IOCB_t *icmd;
4062 IOCB_t *oldcmd; 4030 IOCB_t *oldcmd;
4063 struct lpfc_iocbq *elsiocb; 4031 struct lpfc_iocbq *elsiocb;
4064 struct lpfc_sli *psli;
4065 uint8_t *pcmd; 4032 uint8_t *pcmd;
4066 uint16_t cmdsize; 4033 uint16_t cmdsize;
4067 int rc; 4034 int rc;
4068 4035
4069 psli = &phba->sli;
4070 cmdsize = 2 * sizeof(uint32_t); 4036 cmdsize = 2 * sizeof(uint32_t);
4071 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, 4037 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
4072 ndlp->nlp_DID, ELS_CMD_LS_RJT); 4038 ndlp->nlp_DID, ELS_CMD_LS_RJT);
@@ -4212,13 +4178,10 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
4212 IOCB_t *icmd; 4178 IOCB_t *icmd;
4213 IOCB_t *oldcmd; 4179 IOCB_t *oldcmd;
4214 struct lpfc_iocbq *elsiocb; 4180 struct lpfc_iocbq *elsiocb;
4215 struct lpfc_sli *psli;
4216 uint8_t *pcmd; 4181 uint8_t *pcmd;
4217 uint16_t cmdsize; 4182 uint16_t cmdsize;
4218 int rc; 4183 int rc;
4219 4184
4220 psli = &phba->sli;
4221
4222 cmdsize = sizeof(uint32_t) + sizeof(PRLI); 4185 cmdsize = sizeof(uint32_t) + sizeof(PRLI);
4223 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, 4186 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
4224 ndlp->nlp_DID, (ELS_CMD_ACC | (ELS_CMD_PRLI & ~ELS_RSP_MASK))); 4187 ndlp->nlp_DID, (ELS_CMD_ACC | (ELS_CMD_PRLI & ~ELS_RSP_MASK)));
@@ -4315,12 +4278,10 @@ lpfc_els_rsp_rnid_acc(struct lpfc_vport *vport, uint8_t format,
4315 RNID *rn; 4278 RNID *rn;
4316 IOCB_t *icmd, *oldcmd; 4279 IOCB_t *icmd, *oldcmd;
4317 struct lpfc_iocbq *elsiocb; 4280 struct lpfc_iocbq *elsiocb;
4318 struct lpfc_sli *psli;
4319 uint8_t *pcmd; 4281 uint8_t *pcmd;
4320 uint16_t cmdsize; 4282 uint16_t cmdsize;
4321 int rc; 4283 int rc;
4322 4284
4323 psli = &phba->sli;
4324 cmdsize = sizeof(uint32_t) + sizeof(uint32_t) 4285 cmdsize = sizeof(uint32_t) + sizeof(uint32_t)
4325 + (2 * sizeof(struct lpfc_name)); 4286 + (2 * sizeof(struct lpfc_name));
4326 if (format) 4287 if (format)
@@ -4447,12 +4408,10 @@ lpfc_els_rsp_echo_acc(struct lpfc_vport *vport, uint8_t *data,
4447{ 4408{
4448 struct lpfc_hba *phba = vport->phba; 4409 struct lpfc_hba *phba = vport->phba;
4449 struct lpfc_iocbq *elsiocb; 4410 struct lpfc_iocbq *elsiocb;
4450 struct lpfc_sli *psli;
4451 uint8_t *pcmd; 4411 uint8_t *pcmd;
4452 uint16_t cmdsize; 4412 uint16_t cmdsize;
4453 int rc; 4413 int rc;
4454 4414
4455 psli = &phba->sli;
4456 cmdsize = oldiocb->iocb.unsli3.rcvsli3.acc_len; 4415 cmdsize = oldiocb->iocb.unsli3.rcvsli3.acc_len;
4457 4416
4458 /* The accumulated length can exceed the BPL_SIZE. For 4417 /* The accumulated length can exceed the BPL_SIZE. For
@@ -5181,14 +5140,12 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
5181{ 5140{
5182 struct lpfc_hba *phba = vport->phba; 5141 struct lpfc_hba *phba = vport->phba;
5183 struct lpfc_dmabuf *pcmd; 5142 struct lpfc_dmabuf *pcmd;
5184 IOCB_t *icmd;
5185 uint8_t *lp; 5143 uint8_t *lp;
5186 struct fc_lcb_request_frame *beacon; 5144 struct fc_lcb_request_frame *beacon;
5187 struct lpfc_lcb_context *lcb_context; 5145 struct lpfc_lcb_context *lcb_context;
5188 uint8_t state, rjt_err; 5146 uint8_t state, rjt_err;
5189 struct ls_rjt stat; 5147 struct ls_rjt stat;
5190 5148
5191 icmd = &cmdiocb->iocb;
5192 pcmd = (struct lpfc_dmabuf *)cmdiocb->context2; 5149 pcmd = (struct lpfc_dmabuf *)cmdiocb->context2;
5193 lp = (uint8_t *)pcmd->virt; 5150 lp = (uint8_t *)pcmd->virt;
5194 beacon = (struct fc_lcb_request_frame *)pcmd->virt; 5151 beacon = (struct fc_lcb_request_frame *)pcmd->virt;
@@ -5481,13 +5438,11 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
5481 struct lpfc_hba *phba = vport->phba; 5438 struct lpfc_hba *phba = vport->phba;
5482 struct lpfc_dmabuf *pcmd; 5439 struct lpfc_dmabuf *pcmd;
5483 uint32_t *lp, *datap; 5440 uint32_t *lp, *datap;
5484 IOCB_t *icmd;
5485 uint32_t payload_len, length, nportid, *cmd; 5441 uint32_t payload_len, length, nportid, *cmd;
5486 int rscn_cnt; 5442 int rscn_cnt;
5487 int rscn_id = 0, hba_id = 0; 5443 int rscn_id = 0, hba_id = 0;
5488 int i; 5444 int i;
5489 5445
5490 icmd = &cmdiocb->iocb;
5491 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; 5446 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2;
5492 lp = (uint32_t *) pcmd->virt; 5447 lp = (uint32_t *) pcmd->virt;
5493 5448
@@ -5943,12 +5898,10 @@ lpfc_els_rcv_rnid(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
5943{ 5898{
5944 struct lpfc_dmabuf *pcmd; 5899 struct lpfc_dmabuf *pcmd;
5945 uint32_t *lp; 5900 uint32_t *lp;
5946 IOCB_t *icmd;
5947 RNID *rn; 5901 RNID *rn;
5948 struct ls_rjt stat; 5902 struct ls_rjt stat;
5949 uint32_t cmd; 5903 uint32_t cmd;
5950 5904
5951 icmd = &cmdiocb->iocb;
5952 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; 5905 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2;
5953 lp = (uint32_t *) pcmd->virt; 5906 lp = (uint32_t *) pcmd->virt;
5954 5907
@@ -6259,7 +6212,6 @@ lpfc_els_rcv_rls(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
6259{ 6212{
6260 struct lpfc_hba *phba = vport->phba; 6213 struct lpfc_hba *phba = vport->phba;
6261 LPFC_MBOXQ_t *mbox; 6214 LPFC_MBOXQ_t *mbox;
6262 struct lpfc_dmabuf *pcmd;
6263 struct ls_rjt stat; 6215 struct ls_rjt stat;
6264 6216
6265 if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && 6217 if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
@@ -6267,8 +6219,6 @@ lpfc_els_rcv_rls(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
6267 /* reject the unsolicited RPS request and done with it */ 6219 /* reject the unsolicited RPS request and done with it */
6268 goto reject_out; 6220 goto reject_out;
6269 6221
6270 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2;
6271
6272 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC); 6222 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC);
6273 if (mbox) { 6223 if (mbox) {
6274 lpfc_read_lnk_stat(phba, mbox); 6224 lpfc_read_lnk_stat(phba, mbox);
@@ -6482,7 +6432,6 @@ lpfc_issue_els_rrq(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
6482{ 6432{
6483 struct lpfc_hba *phba = vport->phba; 6433 struct lpfc_hba *phba = vport->phba;
6484 struct RRQ *els_rrq; 6434 struct RRQ *els_rrq;
6485 IOCB_t *icmd;
6486 struct lpfc_iocbq *elsiocb; 6435 struct lpfc_iocbq *elsiocb;
6487 uint8_t *pcmd; 6436 uint8_t *pcmd;
6488 uint16_t cmdsize; 6437 uint16_t cmdsize;
@@ -6501,7 +6450,6 @@ lpfc_issue_els_rrq(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
6501 if (!elsiocb) 6450 if (!elsiocb)
6502 return 1; 6451 return 1;
6503 6452
6504 icmd = &elsiocb->iocb;
6505 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 6453 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
6506 6454
6507 /* For RRQ request, remainder of payload is Exchange IDs */ 6455 /* For RRQ request, remainder of payload is Exchange IDs */
@@ -8428,7 +8376,6 @@ lpfc_issue_els_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
8428{ 8376{
8429 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 8377 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
8430 struct lpfc_hba *phba = vport->phba; 8378 struct lpfc_hba *phba = vport->phba;
8431 IOCB_t *icmd;
8432 struct lpfc_iocbq *elsiocb; 8379 struct lpfc_iocbq *elsiocb;
8433 uint8_t *pcmd; 8380 uint8_t *pcmd;
8434 uint16_t cmdsize; 8381 uint16_t cmdsize;
@@ -8439,7 +8386,6 @@ lpfc_issue_els_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
8439 if (!elsiocb) 8386 if (!elsiocb)
8440 return 1; 8387 return 1;
8441 8388
8442 icmd = &elsiocb->iocb;
8443 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 8389 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
8444 *((uint32_t *) (pcmd)) = ELS_CMD_LOGO; 8390 *((uint32_t *) (pcmd)) = ELS_CMD_LOGO;
8445 pcmd += sizeof(uint32_t); 8391 pcmd += sizeof(uint32_t);
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 759cbebed7c7..71b90447b21c 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -800,7 +800,6 @@ lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove)
800 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 800 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
801 struct lpfc_hba *phba = vport->phba; 801 struct lpfc_hba *phba = vport->phba;
802 struct lpfc_nodelist *ndlp, *next_ndlp; 802 struct lpfc_nodelist *ndlp, *next_ndlp;
803 int rc;
804 803
805 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { 804 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
806 if (!NLP_CHK_NODE_ACT(ndlp)) 805 if (!NLP_CHK_NODE_ACT(ndlp))
@@ -816,10 +815,10 @@ lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove)
816 if ((phba->sli_rev < LPFC_SLI_REV4) && 815 if ((phba->sli_rev < LPFC_SLI_REV4) &&
817 (!remove && ndlp->nlp_type & NLP_FABRIC)) 816 (!remove && ndlp->nlp_type & NLP_FABRIC))
818 continue; 817 continue;
819 rc = lpfc_disc_state_machine(vport, ndlp, NULL, 818 lpfc_disc_state_machine(vport, ndlp, NULL,
820 remove 819 remove
821 ? NLP_EVT_DEVICE_RM 820 ? NLP_EVT_DEVICE_RM
822 : NLP_EVT_DEVICE_RECOVERY); 821 : NLP_EVT_DEVICE_RECOVERY);
823 } 822 }
824 if (phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) { 823 if (phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) {
825 if (phba->sli_rev == LPFC_SLI_REV4) 824 if (phba->sli_rev == LPFC_SLI_REV4)
@@ -1774,7 +1773,6 @@ lpfc_sli4_fcf_rec_mbox_parse(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
1774 uint16_t *next_fcf_index) 1773 uint16_t *next_fcf_index)
1775{ 1774{
1776 void *virt_addr; 1775 void *virt_addr;
1777 dma_addr_t phys_addr;
1778 struct lpfc_mbx_sge sge; 1776 struct lpfc_mbx_sge sge;
1779 struct lpfc_mbx_read_fcf_tbl *read_fcf; 1777 struct lpfc_mbx_read_fcf_tbl *read_fcf;
1780 uint32_t shdr_status, shdr_add_status, if_type; 1778 uint32_t shdr_status, shdr_add_status, if_type;
@@ -1785,7 +1783,6 @@ lpfc_sli4_fcf_rec_mbox_parse(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
1785 * routine only uses a single SGE. 1783 * routine only uses a single SGE.
1786 */ 1784 */
1787 lpfc_sli4_mbx_sge_get(mboxq, 0, &sge); 1785 lpfc_sli4_mbx_sge_get(mboxq, 0, &sge);
1788 phys_addr = getPaddr(sge.pa_hi, sge.pa_lo);
1789 if (unlikely(!mboxq->sge_array)) { 1786 if (unlikely(!mboxq->sge_array)) {
1790 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 1787 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
1791 "2524 Failed to get the non-embedded SGE " 1788 "2524 Failed to get the non-embedded SGE "
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index bedbfe6f42d2..5a9786751837 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -10282,7 +10282,7 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid)
10282 struct lpfc_hba *phba; 10282 struct lpfc_hba *phba;
10283 struct lpfc_vport *vport = NULL; 10283 struct lpfc_vport *vport = NULL;
10284 struct Scsi_Host *shost = NULL; 10284 struct Scsi_Host *shost = NULL;
10285 int error, ret; 10285 int error;
10286 uint32_t cfg_mode, intr_mode; 10286 uint32_t cfg_mode, intr_mode;
10287 int adjusted_fcp_io_channel; 10287 int adjusted_fcp_io_channel;
10288 10288
@@ -10406,7 +10406,7 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid)
10406 10406
10407 /* check for firmware upgrade or downgrade */ 10407 /* check for firmware upgrade or downgrade */
10408 if (phba->cfg_request_firmware_upgrade) 10408 if (phba->cfg_request_firmware_upgrade)
10409 ret = lpfc_sli4_request_firmware_update(phba, INT_FW_UPGRADE); 10409 lpfc_sli4_request_firmware_update(phba, INT_FW_UPGRADE);
10410 10410
10411 /* Check if there are static vports to be created. */ 10411 /* Check if there are static vports to be created. */
10412 lpfc_create_static_vport(phba); 10412 lpfc_create_static_vport(phba);
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index 4abb93a83e0f..18838ea4b6aa 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -289,9 +289,7 @@ lpfc_read_topology(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb,
289 struct lpfc_dmabuf *mp) 289 struct lpfc_dmabuf *mp)
290{ 290{
291 MAILBOX_t *mb; 291 MAILBOX_t *mb;
292 struct lpfc_sli *psli;
293 292
294 psli = &phba->sli;
295 mb = &pmb->u.mb; 293 mb = &pmb->u.mb;
296 memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); 294 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
297 295
@@ -483,13 +481,11 @@ lpfc_init_link(struct lpfc_hba * phba,
483 LPFC_MBOXQ_t * pmb, uint32_t topology, uint32_t linkspeed) 481 LPFC_MBOXQ_t * pmb, uint32_t topology, uint32_t linkspeed)
484{ 482{
485 lpfc_vpd_t *vpd; 483 lpfc_vpd_t *vpd;
486 struct lpfc_sli *psli;
487 MAILBOX_t *mb; 484 MAILBOX_t *mb;
488 485
489 mb = &pmb->u.mb; 486 mb = &pmb->u.mb;
490 memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); 487 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
491 488
492 psli = &phba->sli;
493 switch (topology) { 489 switch (topology) {
494 case FLAGS_TOPOLOGY_MODE_LOOP_PT: 490 case FLAGS_TOPOLOGY_MODE_LOOP_PT:
495 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_LOOP; 491 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_LOOP;
@@ -585,9 +581,7 @@ lpfc_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, int vpi)
585{ 581{
586 struct lpfc_dmabuf *mp; 582 struct lpfc_dmabuf *mp;
587 MAILBOX_t *mb; 583 MAILBOX_t *mb;
588 struct lpfc_sli *psli;
589 584
590 psli = &phba->sli;
591 mb = &pmb->u.mb; 585 mb = &pmb->u.mb;
592 memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); 586 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
593 587
@@ -2010,7 +2004,6 @@ lpfc_sli4_mbx_read_fcf_rec(struct lpfc_hba *phba,
2010 uint16_t fcf_index) 2004 uint16_t fcf_index)
2011{ 2005{
2012 void *virt_addr; 2006 void *virt_addr;
2013 dma_addr_t phys_addr;
2014 uint8_t *bytep; 2007 uint8_t *bytep;
2015 struct lpfc_mbx_sge sge; 2008 struct lpfc_mbx_sge sge;
2016 uint32_t alloc_len, req_len; 2009 uint32_t alloc_len, req_len;
@@ -2039,7 +2032,6 @@ lpfc_sli4_mbx_read_fcf_rec(struct lpfc_hba *phba,
2039 * routine only uses a single SGE. 2032 * routine only uses a single SGE.
2040 */ 2033 */
2041 lpfc_sli4_mbx_sge_get(mboxq, 0, &sge); 2034 lpfc_sli4_mbx_sge_get(mboxq, 0, &sge);
2042 phys_addr = getPaddr(sge.pa_hi, sge.pa_lo);
2043 virt_addr = mboxq->sge_array->addr[0]; 2035 virt_addr = mboxq->sge_array->addr[0];
2044 read_fcf = (struct lpfc_mbx_read_fcf_tbl *)virt_addr; 2036 read_fcf = (struct lpfc_mbx_read_fcf_tbl *)virt_addr;
2045 2037
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index af3b38aba65e..ed9a2c80c4aa 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -820,7 +820,6 @@ lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
820{ 820{
821 struct lpfc_hba *phba; 821 struct lpfc_hba *phba;
822 LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; 822 LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg;
823 MAILBOX_t *mb;
824 uint16_t rpi; 823 uint16_t rpi;
825 824
826 phba = vport->phba; 825 phba = vport->phba;
@@ -828,7 +827,6 @@ lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
828 if (!(phba->pport->load_flag & FC_UNLOADING) && 827 if (!(phba->pport->load_flag & FC_UNLOADING) &&
829 (evt == NLP_EVT_CMPL_REG_LOGIN) && 828 (evt == NLP_EVT_CMPL_REG_LOGIN) &&
830 (!pmb->u.mb.mbxStatus)) { 829 (!pmb->u.mb.mbxStatus)) {
831 mb = &pmb->u.mb;
832 rpi = pmb->u.mb.un.varWords[0]; 830 rpi = pmb->u.mb.un.varWords[0];
833 lpfc_release_rpi(phba, vport, rpi); 831 lpfc_release_rpi(phba, vport, rpi);
834 } 832 }
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index e5eb40d2c512..051b3b3bd625 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -1293,7 +1293,6 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1293 uint32_t *reftag, uint16_t *apptag, uint32_t new_guard) 1293 uint32_t *reftag, uint16_t *apptag, uint32_t new_guard)
1294{ 1294{
1295 struct scatterlist *sgpe; /* s/g prot entry */ 1295 struct scatterlist *sgpe; /* s/g prot entry */
1296 struct scatterlist *sgde; /* s/g data entry */
1297 struct lpfc_scsi_buf *lpfc_cmd = NULL; 1296 struct lpfc_scsi_buf *lpfc_cmd = NULL;
1298 struct scsi_dif_tuple *src = NULL; 1297 struct scsi_dif_tuple *src = NULL;
1299 struct lpfc_nodelist *ndlp; 1298 struct lpfc_nodelist *ndlp;
@@ -1309,7 +1308,6 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1309 return 0; 1308 return 0;
1310 1309
1311 sgpe = scsi_prot_sglist(sc); 1310 sgpe = scsi_prot_sglist(sc);
1312 sgde = scsi_sglist(sc);
1313 lba = scsi_get_lba(sc); 1311 lba = scsi_get_lba(sc);
1314 1312
1315 /* First check if we need to match the LBA */ 1313 /* First check if we need to match the LBA */
@@ -1882,7 +1880,6 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1882#endif 1880#endif
1883 uint32_t checking = 1; 1881 uint32_t checking = 1;
1884 uint32_t reftag; 1882 uint32_t reftag;
1885 unsigned blksize;
1886 uint8_t txop, rxop; 1883 uint8_t txop, rxop;
1887 1884
1888 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); 1885 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop);
@@ -1890,7 +1887,6 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1890 goto out; 1887 goto out;
1891 1888
1892 /* extract some info from the scsi command for pde*/ 1889 /* extract some info from the scsi command for pde*/
1893 blksize = lpfc_cmd_blksize(sc);
1894 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ 1890 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */
1895 1891
1896#ifdef CONFIG_SCSI_LPFC_DEBUG_FS 1892#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
@@ -2263,7 +2259,6 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
2263 dma_addr_t physaddr; 2259 dma_addr_t physaddr;
2264 int i = 0, num_sge = 0, status; 2260 int i = 0, num_sge = 0, status;
2265 uint32_t reftag; 2261 uint32_t reftag;
2266 unsigned blksize;
2267 uint8_t txop, rxop; 2262 uint8_t txop, rxop;
2268#ifdef CONFIG_SCSI_LPFC_DEBUG_FS 2263#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
2269 uint32_t rc; 2264 uint32_t rc;
@@ -2277,7 +2272,6 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
2277 goto out; 2272 goto out;
2278 2273
2279 /* extract some info from the scsi command for pde*/ 2274 /* extract some info from the scsi command for pde*/
2280 blksize = lpfc_cmd_blksize(sc);
2281 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ 2275 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */
2282 2276
2283#ifdef CONFIG_SCSI_LPFC_DEBUG_FS 2277#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
@@ -2881,7 +2875,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
2881 struct scsi_cmnd *cmd = lpfc_cmd->pCmd; 2875 struct scsi_cmnd *cmd = lpfc_cmd->pCmd;
2882 struct scsi_dif_tuple *src = NULL; 2876 struct scsi_dif_tuple *src = NULL;
2883 uint8_t *data_src = NULL; 2877 uint8_t *data_src = NULL;
2884 uint16_t guard_tag, guard_type; 2878 uint16_t guard_tag;
2885 uint16_t start_app_tag, app_tag; 2879 uint16_t start_app_tag, app_tag;
2886 uint32_t start_ref_tag, ref_tag; 2880 uint32_t start_ref_tag, ref_tag;
2887 int prot, protsegcnt; 2881 int prot, protsegcnt;
@@ -2922,7 +2916,6 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
2922 data_len = sgde->length; 2916 data_len = sgde->length;
2923 if ((data_len & (blksize - 1)) == 0) 2917 if ((data_len & (blksize - 1)) == 0)
2924 chk_guard = 1; 2918 chk_guard = 1;
2925 guard_type = scsi_host_get_guard(cmd->device->host);
2926 2919
2927 src = (struct scsi_dif_tuple *)sg_virt(sgpe); 2920 src = (struct scsi_dif_tuple *)sg_virt(sgpe);
2928 start_ref_tag = (uint32_t)scsi_get_lba(cmd); /* Truncate LBA */ 2921 start_ref_tag = (uint32_t)scsi_get_lba(cmd); /* Truncate LBA */
@@ -3908,12 +3901,10 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
3908 struct lpfc_rport_data *rdata = lpfc_cmd->rdata; 3901 struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
3909 struct lpfc_nodelist *pnode = rdata->pnode; 3902 struct lpfc_nodelist *pnode = rdata->pnode;
3910 struct scsi_cmnd *cmd; 3903 struct scsi_cmnd *cmd;
3911 int result;
3912 int depth; 3904 int depth;
3913 unsigned long flags; 3905 unsigned long flags;
3914 struct lpfc_fast_path_event *fast_path_evt; 3906 struct lpfc_fast_path_event *fast_path_evt;
3915 struct Scsi_Host *shost; 3907 struct Scsi_Host *shost;
3916 uint32_t queue_depth, scsi_id;
3917 uint32_t logit = LOG_FCP; 3908 uint32_t logit = LOG_FCP;
3918 3909
3919 /* Sanity check on return of outstanding command */ 3910 /* Sanity check on return of outstanding command */
@@ -4095,7 +4086,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
4095 } 4086 }
4096 4087
4097 lpfc_update_stats(phba, lpfc_cmd); 4088 lpfc_update_stats(phba, lpfc_cmd);
4098 result = cmd->result;
4099 if (vport->cfg_max_scsicmpl_time && 4089 if (vport->cfg_max_scsicmpl_time &&
4100 time_after(jiffies, lpfc_cmd->start_time + 4090 time_after(jiffies, lpfc_cmd->start_time +
4101 msecs_to_jiffies(vport->cfg_max_scsicmpl_time))) { 4091 msecs_to_jiffies(vport->cfg_max_scsicmpl_time))) {
@@ -4132,8 +4122,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
4132 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd); 4122 lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd);
4133 4123
4134 /* The sdev is not guaranteed to be valid post scsi_done upcall. */ 4124 /* The sdev is not guaranteed to be valid post scsi_done upcall. */
4135 queue_depth = cmd->device->queue_depth;
4136 scsi_id = cmd->device->id;
4137 cmd->scsi_done(cmd); 4125 cmd->scsi_done(cmd);
4138 4126
4139 if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { 4127 if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 95d53c734847..f9585cdd8933 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -12491,12 +12491,10 @@ lpfc_sli4_fof_intr_handler(int irq, void *dev_id)
12491 struct lpfc_eqe *eqe; 12491 struct lpfc_eqe *eqe;
12492 unsigned long iflag; 12492 unsigned long iflag;
12493 int ecount = 0; 12493 int ecount = 0;
12494 uint32_t eqidx;
12495 12494
12496 /* Get the driver's phba structure from the dev_id */ 12495 /* Get the driver's phba structure from the dev_id */
12497 fcp_eq_hdl = (struct lpfc_fcp_eq_hdl *)dev_id; 12496 fcp_eq_hdl = (struct lpfc_fcp_eq_hdl *)dev_id;
12498 phba = fcp_eq_hdl->phba; 12497 phba = fcp_eq_hdl->phba;
12499 eqidx = fcp_eq_hdl->idx;
12500 12498
12501 if (unlikely(!phba)) 12499 if (unlikely(!phba))
12502 return IRQ_NONE; 12500 return IRQ_NONE;
@@ -12831,12 +12829,8 @@ out_fail:
12831static void __iomem * 12829static void __iomem *
12832lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset) 12830lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset)
12833{ 12831{
12834 struct pci_dev *pdev;
12835
12836 if (!phba->pcidev) 12832 if (!phba->pcidev)
12837 return NULL; 12833 return NULL;
12838 else
12839 pdev = phba->pcidev;
12840 12834
12841 switch (pci_barset) { 12835 switch (pci_barset) {
12842 case WQ_PCI_BAR_0_AND_1: 12836 case WQ_PCI_BAR_0_AND_1:
@@ -15920,7 +15914,6 @@ lpfc_sli4_add_fcf_record(struct lpfc_hba *phba, struct fcf_record *fcf_record)
15920 LPFC_MBOXQ_t *mboxq; 15914 LPFC_MBOXQ_t *mboxq;
15921 uint8_t *bytep; 15915 uint8_t *bytep;
15922 void *virt_addr; 15916 void *virt_addr;
15923 dma_addr_t phys_addr;
15924 struct lpfc_mbx_sge sge; 15917 struct lpfc_mbx_sge sge;
15925 uint32_t alloc_len, req_len; 15918 uint32_t alloc_len, req_len;
15926 uint32_t fcfindex; 15919 uint32_t fcfindex;
@@ -15953,7 +15946,6 @@ lpfc_sli4_add_fcf_record(struct lpfc_hba *phba, struct fcf_record *fcf_record)
15953 * routine only uses a single SGE. 15946 * routine only uses a single SGE.
15954 */ 15947 */
15955 lpfc_sli4_mbx_sge_get(mboxq, 0, &sge); 15948 lpfc_sli4_mbx_sge_get(mboxq, 0, &sge);
15956 phys_addr = getPaddr(sge.pa_hi, sge.pa_lo);
15957 virt_addr = mboxq->sge_array->addr[0]; 15949 virt_addr = mboxq->sge_array->addr[0];
15958 /* 15950 /*
15959 * Configure the FCF record for FCFI 0. This is the driver's 15951 * Configure the FCF record for FCFI 0. This is the driver's