linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] scsi: lpfc: fix unused variable warning
@ 2019-03-04 19:39 Arnd Bergmann
  2019-03-04 19:39 ` [PATCH 2/4] scsi: lpfc: fix 32-bit format string warning Arnd Bergmann
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Arnd Bergmann @ 2019-03-04 19:39 UTC (permalink / raw)
  To: James Smart, Dick Kennedy, James E.J. Bottomley, Martin K. Petersen
  Cc: Arnd Bergmann, Hannes Reinecke, linux-scsi, linux-kernel

The newly introduced 'cpu' variable is only used inside of an optional
block, so we get a warning without CONFIG_SCSI_LPFC_DEBUG_FS:

drivers/scsi/lpfc/lpfc_nvme.c: In function 'lpfc_nvme_io_cmd_wqe_cmpl':
drivers/scsi/lpfc/lpfc_nvme.c:968:30: error: unused variable 'cpu' [-Werror=unused-variable]
  uint32_t code, status, idx, cpu;

Move the declaration into the same block to avoid the warning.

Fixes: 63df6d637e33 ("scsi: lpfc: Adapt cpucheck debugfs logic to Hardware Queues")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/lpfc/lpfc_nvme.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index 72cb8ad9027b..d16ca413110d 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -965,7 +965,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
 	struct lpfc_nodelist *ndlp;
 	struct lpfc_nvme_fcpreq_priv *freqpriv;
 	struct lpfc_nvme_lport *lport;
-	uint32_t code, status, idx, cpu;
+	uint32_t code, status, idx;
 	uint16_t cid, sqhd, data;
 	uint32_t *ptr;
 
@@ -1139,6 +1139,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
 		lpfc_nvme_ktime(phba, lpfc_ncmd);
 	}
 	if (phba->cpucheck_on & LPFC_CHECK_NVME_IO) {
+		uint32_t cpu;
 		idx = lpfc_ncmd->cur_iocbq.hba_wqidx;
 		cpu = smp_processor_id();
 		if (cpu < LPFC_CHECK_CPU_CNT) {
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-07  0:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 19:39 [PATCH 1/4] scsi: lpfc: fix unused variable warning Arnd Bergmann
2019-03-04 19:39 ` [PATCH 2/4] scsi: lpfc: fix 32-bit format string warning Arnd Bergmann
2019-03-07  0:15   ` Martin K. Petersen
2019-03-04 19:39 ` [PATCH 3/4] scsi: qla2xxx: avoid printf format warning Arnd Bergmann
2019-03-06 17:29   ` Himanshu Madhani
2019-03-06 17:54   ` Martin K. Petersen
2019-03-04 19:39 ` [PATCH 4/4] scsi: ufs: hisi: fix ufs_hba_variant_ops passing Arnd Bergmann
2019-03-06 11:43   ` Avri Altman
2019-03-06 17:45   ` Martin K. Petersen
2019-03-07  0:15 ` [PATCH 1/4] scsi: lpfc: fix unused variable warning Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).