linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: James Smart <james.smart@broadcom.com>,
	Dick Kennedy <dick.kennedy@broadcom.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Gaurav Srivastava <gaurav.srivastava@broadcom.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] scsi: lpfc: Reduce scope of uuid in lpfc_queuecommand()
Date: Thu, 17 Jun 2021 16:37:59 -0700	[thread overview]
Message-ID: <20210617233759.2355447-1-nathan@kernel.org> (raw)

When CONFIG_SCSI_LPFC_DEBUG_FS is unset, uuid's declaration is not
present, resulting in a compiler error:

drivers/scsi/lpfc/lpfc_scsi.c:5595:3: error: use of undeclared
identifier 'uuid'
                uuid = lpfc_is_command_vm_io(cmnd);
                ^

uuid is only used in the if statement so reduce its scope to solve the
build error. Additionally, uuid is a char *, instead of u8 *.

Fixes: 33c79741deaf ("scsi: lpfc: vmid: Introduce VMID in I/O path")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/scsi/lpfc/lpfc_scsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 46bfe251c2fe..e8af51e38614 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5457,7 +5457,6 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	int err, idx;
 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
 	uint64_t start = 0L;
-	u8 *uuid = NULL;
 
 	if (phba->ktime_on)
 		start = ktime_get_ns();
@@ -5592,7 +5591,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	     LPFC_VMID_PRIO_TAG_ALL_TARGETS)) {
 		/* is the I/O generated by a VM, get the associated virtual */
 		/* entity id */
-		uuid = lpfc_is_command_vm_io(cmnd);
+		char *uuid = lpfc_is_command_vm_io(cmnd);
 
 		if (uuid) {
 			err = lpfc_vmid_get_appid(vport, uuid, cmnd,

base-commit: ebc076b3eddc807729bd81f7bc48e798a3ddc477
-- 
2.32.0.93.g670b81a890


                 reply	other threads:[~2021-06-17 23:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210617233759.2355447-1-nathan@kernel.org \
    --to=nathan@kernel.org \
    --cc=dick.kennedy@broadcom.com \
    --cc=gaurav.srivastava@broadcom.com \
    --cc=james.smart@broadcom.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --subject='Re: [PATCH] scsi: lpfc: Reduce scope of uuid in lpfc_queuecommand()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox