From patchwork Thu Mar 28 18:06:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10875667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 329CA18FD for ; Thu, 28 Mar 2019 18:06:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B33D28DE8 for ; Thu, 28 Mar 2019 18:06:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FBD028DE7; Thu, 28 Mar 2019 18:06:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D53B628DF9 for ; Thu, 28 Mar 2019 18:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbfC1SGg (ORCPT ); Thu, 28 Mar 2019 14:06:36 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40879 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbfC1SGg (ORCPT ); Thu, 28 Mar 2019 14:06:36 -0400 Received: by mail-pg1-f194.google.com with SMTP id u9so11966683pgo.7 for ; Thu, 28 Mar 2019 11:06:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=liqwqU767pvyNYR8UyvwJq+y9tIinlp/4uN2y2wYW+w=; b=dOOM/+daUNhlCUa64FbTbiWZGDLwNzhEHrGrzd0RVqMYgBIBYnZvRgMbJAN/xkV5Pr hcoQMn6ozZrrtWviUmKpZvN2Ds7VukUYFnHBLZNLjk9yBT7pj7r+G+6I8zjbx63hE2HD df3TKulM6zB9VS+3TFHB7kT4ecXCE3QDMOiDJLR46pzySkI60OJuDnus/LC5JmsqF9IA cU4BI/bPZlyWAIA2L85IAy+k+Vy6epelCIsqOGJ3igBWTtnNI+CTkjq4jAeayIGeoE7c wDPq4v4RYofzDL+oq5QwSpgxrab030GJtJcDKQpuNL4LEwrxofoTpD7DXJc9VJMvHry2 PRJA== X-Gm-Message-State: APjAAAUL5S+8vQtkiL+Hbv58R/jwF/kbGZUMrhMMEReWXKlCnrJnFRJ2 ZhP1isfvaA0qlwkr9MalVfE= X-Google-Smtp-Source: APXvYqztcP2PJ5fTP62kywA340tFoo3v5CUsWs4oIZsAWzmuZZeBUvpjPl8yOYDE+y3TUj1fnNvM0A== X-Received: by 2002:aa7:820c:: with SMTP id k12mr18542266pfi.177.1553796395281; Thu, 28 Mar 2019 11:06:35 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id k72sm72025267pfb.122.2019.03.28.11.06.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 11:06:34 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , Bart Van Assche , James Smart Subject: [PATCH 5/7] lpfc: Remove set-but-not-used variables Date: Thu, 28 Mar 2019 11:06:20 -0700 Message-Id: <20190328180622.34984-6-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190328180622.34984-1-bvanassche@acm.org> References: <20190328180622.34984-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Bart Van Assche --- drivers/scsi/lpfc/lpfc_els.c | 24 ++++++++++-------------- drivers/scsi/lpfc/lpfc_nportdisc.c | 5 ++--- drivers/scsi/lpfc/lpfc_nvmet.c | 15 +++------------ 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index cacd63a3cd08..61348915c942 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1961,7 +1961,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, IOCB_t *irsp; struct lpfc_nodelist *ndlp; struct lpfc_dmabuf *prsp; - int disc, rc; + int disc; /* we pass cmdiocb to state machine which needs rspiocb as well */ cmdiocb->context_un.rsp_iocb = rspiocb; @@ -1990,7 +1990,6 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); - rc = 0; /* PLOGI completes to NPort */ lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, @@ -2029,18 +2028,16 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4]); /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ - if (lpfc_error_lost_link(irsp)) - rc = NLP_STE_FREED_NODE; - else - rc = lpfc_disc_state_machine(vport, ndlp, cmdiocb, - NLP_EVT_CMPL_PLOGI); + if (!lpfc_error_lost_link(irsp)) + lpfc_disc_state_machine(vport, ndlp, cmdiocb, + NLP_EVT_CMPL_PLOGI); } else { /* Good status, call state machine */ prsp = list_entry(((struct lpfc_dmabuf *) cmdiocb->context2)->list.next, struct lpfc_dmabuf, list); ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp); - rc = lpfc_disc_state_machine(vport, ndlp, cmdiocb, + lpfc_disc_state_machine(vport, ndlp, cmdiocb, NLP_EVT_CMPL_PLOGI); } @@ -6744,12 +6741,11 @@ lpfc_els_rcv_rnid(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, uint32_t *lp; RNID *rn; struct ls_rjt stat; - uint32_t cmd; pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; lp = (uint32_t *) pcmd->virt; - cmd = *lp++; + lp++; rn = (RNID *) lp; /* RNID received */ @@ -7508,14 +7504,14 @@ lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, uint32_t *lp; IOCB_t *icmd; FARP *fp; - uint32_t cmd, cnt, did; + uint32_t cnt, did; icmd = &cmdiocb->iocb; did = icmd->un.elsreq64.remoteID; pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; lp = (uint32_t *) pcmd->virt; - cmd = *lp++; + lp++; fp = (FARP *) lp; /* FARP-REQ received from DID */ lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, @@ -7580,14 +7576,14 @@ lpfc_els_rcv_farpr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, struct lpfc_dmabuf *pcmd; uint32_t *lp; IOCB_t *icmd; - uint32_t cmd, did; + uint32_t did; icmd = &cmdiocb->iocb; did = icmd->un.elsreq64.remoteID; pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; lp = (uint32_t *) pcmd->virt; - cmd = *lp++; + lp++; /* FARP-RSP received from DID */ lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, "0600 FARP-RSP received from DID x%x\n", did); diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index e27ba2ad422f..59252bfca14e 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1733,7 +1733,6 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport, LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; MAILBOX_t *mb = &pmb->u.mb; uint32_t did = mb->un.varWords[1]; - int rc = 0; if (mb->mbxStatus) { /* RegLogin failed */ @@ -1806,8 +1805,8 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport, * GFT_ID to determine if remote port supports NVME. */ if (vport->cfg_enable_fc4_type != LPFC_ENABLE_FCP) { - rc = lpfc_ns_cmd(vport, SLI_CTNS_GFT_ID, - 0, ndlp->nlp_DID); + lpfc_ns_cmd(vport, SLI_CTNS_GFT_ID, 0, + ndlp->nlp_DID); return ndlp->nlp_state; } ndlp->nlp_fc4_type = NLP_FC4_FCP; diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index 974b45c6fc66..c125598089e2 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi/lpfc/lpfc_nvmet.c @@ -325,7 +325,6 @@ lpfc_nvmet_ctxbuf_post(struct lpfc_hba *phba, struct lpfc_nvmet_ctxbuf *ctx_buf) struct fc_frame_header *fc_hdr; struct rqb_dmabuf *nvmebuf; struct lpfc_nvmet_ctx_info *infop; - uint32_t *payload; uint32_t size, oxid, sid; int cpu; unsigned long iflag; @@ -370,7 +369,6 @@ lpfc_nvmet_ctxbuf_post(struct lpfc_hba *phba, struct lpfc_nvmet_ctxbuf *ctx_buf) fc_hdr = (struct fc_frame_header *)(nvmebuf->hbuf.virt); oxid = be16_to_cpu(fc_hdr->fh_ox_id); tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; - payload = (uint32_t *)(nvmebuf->dbuf.virt); size = nvmebuf->bytes_recv; sid = sli4_sid_from_fc_hdr(fc_hdr); @@ -2023,7 +2021,6 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba, struct fc_frame_header *fc_hdr; struct lpfc_nvmet_ctxbuf *ctx_buf; struct lpfc_nvmet_ctx_info *current_infop; - uint32_t *payload; uint32_t size, oxid, sid, qno; unsigned long iflag; int current_cpu; @@ -2101,7 +2098,6 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba, return; } - payload = (uint32_t *)(nvmebuf->dbuf.virt); sid = sli4_sid_from_fc_hdr(fc_hdr); ctxp = (struct lpfc_nvmet_rcv_ctx *)ctx_buf->context; @@ -2717,12 +2713,11 @@ lpfc_nvmet_sol_fcp_abort_cmp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdwqe, { struct lpfc_nvmet_rcv_ctx *ctxp; struct lpfc_nvmet_tgtport *tgtp; - uint32_t status, result; + uint32_t result; unsigned long flags; bool released = false; ctxp = cmdwqe->context2; - status = bf_get(lpfc_wcqe_c_status, wcqe); result = wcqe->parameter; tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; @@ -2788,11 +2783,10 @@ lpfc_nvmet_unsol_fcp_abort_cmp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdwqe, struct lpfc_nvmet_rcv_ctx *ctxp; struct lpfc_nvmet_tgtport *tgtp; unsigned long flags; - uint32_t status, result; + uint32_t result; bool released = false; ctxp = cmdwqe->context2; - status = bf_get(lpfc_wcqe_c_status, wcqe); result = wcqe->parameter; if (!ctxp) { @@ -2869,10 +2863,9 @@ lpfc_nvmet_xmt_ls_abort_cmp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdwqe, { struct lpfc_nvmet_rcv_ctx *ctxp; struct lpfc_nvmet_tgtport *tgtp; - uint32_t status, result; + uint32_t result; ctxp = cmdwqe->context2; - status = bf_get(lpfc_wcqe_c_status, wcqe); result = wcqe->parameter; tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; @@ -3227,7 +3220,6 @@ lpfc_nvmet_unsol_ls_issue_abort(struct lpfc_hba *phba, { struct lpfc_nvmet_tgtport *tgtp; struct lpfc_iocbq *abts_wqeq; - union lpfc_wqe128 *wqe_abts; unsigned long flags; int rc; @@ -3257,7 +3249,6 @@ lpfc_nvmet_unsol_ls_issue_abort(struct lpfc_hba *phba, } } abts_wqeq = ctxp->wqeq; - wqe_abts = &abts_wqeq->wqe; if (lpfc_nvmet_unsol_issue_abort(phba, ctxp, sid, xri) == 0) { rc = WQE_BUSY;