aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2020-07-21 17:41:44 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2020-07-24 22:10:02 -0400
commit11d8e56bfd3fbfd470e21e447fedbd0f6e3414a9 (patch)
treecd2df4810f5fb0a7277ddeeaec0262e7db09a836 /drivers/scsi/lpfc
parentscsi: bfa: Staticify all local functions (diff)
downloadlinux-dev-11d8e56bfd3fbfd470e21e447fedbd0f6e3414a9.tar.xz
linux-dev-11d8e56bfd3fbfd470e21e447fedbd0f6e3414a9.zip
scsi: lpfc: Ensure variable has the same stipulations as code using it
'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; | ^~~~~~~ Link: https://lore.kernel.org/r/20200721164148.2617584-37-lee.jones@linaro.org Cc: James Smart <james.smart@broadcom.com> Cc: Dick Kennedy <dick.kennedy@broadcom.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: "Christian König" <christian.koenig@amd.com> Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index c44eed709d5f..278ea0d74b4a 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)