[1/2] scsi: lpfc: avoid an unused function warning

Message ID 20170824231016.1843118-1-arnd@arndb.de
State Accepted
Commit 7362617319fd2273c7fe5a5f8f8b5fb059a85015
Headers show
Series
  • [1/2] scsi: lpfc: avoid an unused function warning
Related show

Commit Message

Arnd Bergmann Aug. 24, 2017, 11:09 p.m.
The only reference to lpfc_nvmet_replenish_context() is inside of
an #ifdef, leading to a harmless warning when CONFIG_NVME_TARGET_FC
is disabled:

drivers/scsi/lpfc/lpfc_nvmet.c:1457:1: error: 'lpfc_nvmet_replenish_context' defined but not used [-Werror=unused-function]

This replaces the preprocessor conditional with a C condition,
so the compiler can see that the function is intentionally unused.

Fixes: 9a38e4f1c82f ("scsi: lpfc: Fix MRQ > 1 context list handling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/scsi/lpfc/lpfc_nvmet.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.9.0

Comments

Martin K. Petersen Aug. 25, 2017, 10:27 p.m. | #1
Arnd,

> The only reference to lpfc_nvmet_replenish_context() is inside of an

> #ifdef, leading to a harmless warning when CONFIG_NVME_TARGET_FC is

> disabled:


Applied to 4.14/scsi-queue. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

Patch

diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index 48a1c0c27a3f..0b7c1a49e203 100644
--- a/drivers/scsi/lpfc/lpfc_nvmet.c
+++ b/drivers/scsi/lpfc/lpfc_nvmet.c
@@ -1527,7 +1527,6 @@  lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba,
 			    struct rqb_dmabuf *nvmebuf,
 			    uint64_t isr_timestamp)
 {
-#if (IS_ENABLED(CONFIG_NVME_TARGET_FC))
 	struct lpfc_nvmet_rcv_ctx *ctxp;
 	struct lpfc_nvmet_tgtport *tgtp;
 	struct fc_frame_header *fc_hdr;
@@ -1541,6 +1540,9 @@  lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba,
 	uint32_t id;
 #endif
 
+	if (!IS_ENABLED(CONFIG_NVME_TARGET_FC))
+		return;
+
 	ctx_buf = NULL;
 	if (!nvmebuf || !phba->targetport) {
 		lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
@@ -1695,7 +1697,6 @@  lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba,
 
 	if (nvmebuf)
 		lpfc_rq_buf_free(phba, &nvmebuf->hbuf); /* repost */
-#endif
 }
 
 /**