[PATCH 36/40] scsi: lpfc: lpfc_sli: Ensure variable has the same stipulations as code using it

From: Lee Jones
Date: Tue Jul 21 2020 - 12:42:56 EST


'pg_addr' is only used when CONFIG_X86 is defined. So only declare it
if CONFIG_X86 is defined.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/lpfc/lpfc_sli.c: In function âlpfc_wq_createâ:
drivers/scsi/lpfc/lpfc_sli.c:15813:16: warning: unused variable âpg_addrâ [-Wunused-variable]
15813 | unsigned long pg_addr;
| ^~~~~~~

Cc: James Smart <james.smart@xxxxxxxxxxxx>
Cc: Dick Kennedy <dick.kennedy@xxxxxxxxxxxx>
Cc: Sumit Semwal <sumit.semwal@xxxxxxxxxx>
Cc: "Christian KÃnig" <christian.koenig@xxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: linaro-mm-sig@xxxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
---
drivers/scsi/lpfc/lpfc_sli.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index c44eed709d5fc..278ea0d74b4a8 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -15810,8 +15810,10 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq,
uint16_t pci_barset;
uint8_t dpp_barset;
uint32_t dpp_offset;
- unsigned long pg_addr;
uint8_t wq_create_version;
+#ifdef CONFIG_X86
+ unsigned long pg_addr;
+#endif

/* sanity check on queue memory */
if (!wq || !cq)
--
2.25.1