Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: lpfc: Remove set-but-not-used variables

This patch does not change any functionality but avoids that the compiler
complains about set-but-not-used variables when building with W=1.

Cc: James Smart <james.smart@broadcom.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
b27cbd55 a73cb814

+15 -29
+10 -14
drivers/scsi/lpfc/lpfc_els.c
··· 1961 1961 IOCB_t *irsp; 1962 1962 struct lpfc_nodelist *ndlp; 1963 1963 struct lpfc_dmabuf *prsp; 1964 - int disc, rc; 1964 + int disc; 1965 1965 1966 1966 /* we pass cmdiocb to state machine which needs rspiocb as well */ 1967 1967 cmdiocb->context_un.rsp_iocb = rspiocb; ··· 1990 1990 disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); 1991 1991 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1992 1992 spin_unlock_irq(shost->host_lock); 1993 - rc = 0; 1994 1993 1995 1994 /* PLOGI completes to NPort <nlp_DID> */ 1996 1995 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, ··· 2028 2029 ndlp->nlp_DID, irsp->ulpStatus, 2029 2030 irsp->un.ulpWord[4]); 2030 2031 /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ 2031 - if (lpfc_error_lost_link(irsp)) 2032 - rc = NLP_STE_FREED_NODE; 2033 - else 2034 - rc = lpfc_disc_state_machine(vport, ndlp, cmdiocb, 2035 - NLP_EVT_CMPL_PLOGI); 2032 + if (!lpfc_error_lost_link(irsp)) 2033 + lpfc_disc_state_machine(vport, ndlp, cmdiocb, 2034 + NLP_EVT_CMPL_PLOGI); 2036 2035 } else { 2037 2036 /* Good status, call state machine */ 2038 2037 prsp = list_entry(((struct lpfc_dmabuf *) 2039 2038 cmdiocb->context2)->list.next, 2040 2039 struct lpfc_dmabuf, list); 2041 2040 ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp); 2042 - rc = lpfc_disc_state_machine(vport, ndlp, cmdiocb, 2041 + lpfc_disc_state_machine(vport, ndlp, cmdiocb, 2043 2042 NLP_EVT_CMPL_PLOGI); 2044 2043 } 2045 2044 ··· 6741 6744 uint32_t *lp; 6742 6745 RNID *rn; 6743 6746 struct ls_rjt stat; 6744 - uint32_t cmd; 6745 6747 6746 6748 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; 6747 6749 lp = (uint32_t *) pcmd->virt; 6748 6750 6749 - cmd = *lp++; 6751 + lp++; 6750 6752 rn = (RNID *) lp; 6751 6753 6752 6754 /* RNID received */ ··· 7504 7508 uint32_t *lp; 7505 7509 IOCB_t *icmd; 7506 7510 FARP *fp; 7507 - uint32_t cmd, cnt, did; 7511 + uint32_t cnt, did; 7508 7512 7509 7513 icmd = &cmdiocb->iocb; 7510 7514 did = icmd->un.elsreq64.remoteID; 7511 7515 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; 7512 7516 lp = (uint32_t *) pcmd->virt; 7513 7517 7514 - cmd = *lp++; 7518 + lp++; 7515 7519 fp = (FARP *) lp; 7516 7520 /* FARP-REQ received from DID <did> */ 7517 7521 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, ··· 7576 7580 struct lpfc_dmabuf *pcmd; 7577 7581 uint32_t *lp; 7578 7582 IOCB_t *icmd; 7579 - uint32_t cmd, did; 7583 + uint32_t did; 7580 7584 7581 7585 icmd = &cmdiocb->iocb; 7582 7586 did = icmd->un.elsreq64.remoteID; 7583 7587 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; 7584 7588 lp = (uint32_t *) pcmd->virt; 7585 7589 7586 - cmd = *lp++; 7590 + lp++; 7587 7591 /* FARP-RSP received from DID <did> */ 7588 7592 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 7589 7593 "0600 FARP-RSP received from DID x%x\n", did);
+2 -3
drivers/scsi/lpfc/lpfc_nportdisc.c
··· 1733 1733 LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; 1734 1734 MAILBOX_t *mb = &pmb->u.mb; 1735 1735 uint32_t did = mb->un.varWords[1]; 1736 - int rc = 0; 1737 1736 1738 1737 if (mb->mbxStatus) { 1739 1738 /* RegLogin failed */ ··· 1805 1806 * GFT_ID to determine if remote port supports NVME. 1806 1807 */ 1807 1808 if (vport->cfg_enable_fc4_type != LPFC_ENABLE_FCP) { 1808 - rc = lpfc_ns_cmd(vport, SLI_CTNS_GFT_ID, 1809 - 0, ndlp->nlp_DID); 1809 + lpfc_ns_cmd(vport, SLI_CTNS_GFT_ID, 0, 1810 + ndlp->nlp_DID); 1810 1811 return ndlp->nlp_state; 1811 1812 } 1812 1813 ndlp->nlp_fc4_type = NLP_FC4_FCP;
+3 -12
drivers/scsi/lpfc/lpfc_nvmet.c
··· 325 325 struct fc_frame_header *fc_hdr; 326 326 struct rqb_dmabuf *nvmebuf; 327 327 struct lpfc_nvmet_ctx_info *infop; 328 - uint32_t *payload; 329 328 uint32_t size, oxid, sid; 330 329 int cpu; 331 330 unsigned long iflag; ··· 369 370 fc_hdr = (struct fc_frame_header *)(nvmebuf->hbuf.virt); 370 371 oxid = be16_to_cpu(fc_hdr->fh_ox_id); 371 372 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; 372 - payload = (uint32_t *)(nvmebuf->dbuf.virt); 373 373 size = nvmebuf->bytes_recv; 374 374 sid = sli4_sid_from_fc_hdr(fc_hdr); 375 375 ··· 2021 2023 struct fc_frame_header *fc_hdr; 2022 2024 struct lpfc_nvmet_ctxbuf *ctx_buf; 2023 2025 struct lpfc_nvmet_ctx_info *current_infop; 2024 - uint32_t *payload; 2025 2026 uint32_t size, oxid, sid, qno; 2026 2027 unsigned long iflag; 2027 2028 int current_cpu; ··· 2098 2101 return; 2099 2102 } 2100 2103 2101 - payload = (uint32_t *)(nvmebuf->dbuf.virt); 2102 2104 sid = sli4_sid_from_fc_hdr(fc_hdr); 2103 2105 2104 2106 ctxp = (struct lpfc_nvmet_rcv_ctx *)ctx_buf->context; ··· 2713 2717 { 2714 2718 struct lpfc_nvmet_rcv_ctx *ctxp; 2715 2719 struct lpfc_nvmet_tgtport *tgtp; 2716 - uint32_t status, result; 2720 + uint32_t result; 2717 2721 unsigned long flags; 2718 2722 bool released = false; 2719 2723 2720 2724 ctxp = cmdwqe->context2; 2721 - status = bf_get(lpfc_wcqe_c_status, wcqe); 2722 2725 result = wcqe->parameter; 2723 2726 2724 2727 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; ··· 2783 2788 struct lpfc_nvmet_rcv_ctx *ctxp; 2784 2789 struct lpfc_nvmet_tgtport *tgtp; 2785 2790 unsigned long flags; 2786 - uint32_t status, result; 2791 + uint32_t result; 2787 2792 bool released = false; 2788 2793 2789 2794 ctxp = cmdwqe->context2; 2790 - status = bf_get(lpfc_wcqe_c_status, wcqe); 2791 2795 result = wcqe->parameter; 2792 2796 2793 2797 if (!ctxp) { ··· 2863 2869 { 2864 2870 struct lpfc_nvmet_rcv_ctx *ctxp; 2865 2871 struct lpfc_nvmet_tgtport *tgtp; 2866 - uint32_t status, result; 2872 + uint32_t result; 2867 2873 2868 2874 ctxp = cmdwqe->context2; 2869 - status = bf_get(lpfc_wcqe_c_status, wcqe); 2870 2875 result = wcqe->parameter; 2871 2876 2872 2877 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; ··· 3220 3227 { 3221 3228 struct lpfc_nvmet_tgtport *tgtp; 3222 3229 struct lpfc_iocbq *abts_wqeq; 3223 - union lpfc_wqe128 *wqe_abts; 3224 3230 unsigned long flags; 3225 3231 int rc; 3226 3232 ··· 3249 3257 } 3250 3258 } 3251 3259 abts_wqeq = ctxp->wqeq; 3252 - wqe_abts = &abts_wqeq->wqe; 3253 3260 3254 3261 if (lpfc_nvmet_unsol_issue_abort(phba, ctxp, sid, xri) == 0) { 3255 3262 rc = WQE_BUSY;