From: Bart Van Assche <bvanassche@acm.org>
Date: Thu, 8 Aug 2019 20:01:31 -0700
Subject: scsi: qla2xxx: Reduce the scope of three local variables in
qla2xxx_queuecommand()
Patch-mainline: v5.4-rc1
Git-commit: 6d58ef05fd33f0f48923d8ed0a8a002c268313e2
References: bsc#1123034 bsc#1131304 bsc#1127988 bsc#1143706
This patch makes it clear that the tag, hwq and qpair variables are only
used in the mq path.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Daniel Wagner <dwagner@suse.de>
---
drivers/scsi/qla2xxx/qla_os.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -864,9 +864,6 @@ qla2xxx_queuecommand(struct Scsi_Host *h
struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
srb_t *sp;
int rval;
- struct qla_qpair *qpair = NULL;
- uint32_t tag;
- uint16_t hwq;
if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags)) ||
WARN_ON_ONCE(!rport)) {
@@ -875,6 +872,10 @@ qla2xxx_queuecommand(struct Scsi_Host *h
}
if (ha->mqenable) {
+ uint32_t tag;
+ uint16_t hwq;
+ struct qla_qpair *qpair = NULL;
+
if (shost_use_blk_mq(vha->host)) {
tag = blk_mq_unique_tag(cmd->request);
hwq = blk_mq_unique_tag_to_hwq(tag);