[PATCH] scsi: fnic: Fix built-in NVMe/FC build
From: Karan Tilak Kumar
Date: Mon Aug 10 2026 - 07:11:21 EST
The fnic NVMe/FC code is guarded with IS_ENABLED(CONFIG_NVME_FC).
That also evaluates true when NVME_FC is built as a module.
When fnic is built into vmlinux and NVME_FC=m, fnic_nvme.o still
references the NVMe/FC transport helpers even though those helpers are
not reachable from built-in code. The final vmlinux link then fails with
undefined nvme_fc_* symbols.
Use IS_REACHABLE(CONFIG_NVME_FC) for the fnic NVMe/FC implementation and
prototypes so built-in fnic uses the disabled stubs unless the NVMe/FC
transport is reachable.
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202608092246.XZe7Hlrt-lkp@xxxxxxxxx/
Reviewed-by: Sesidhar Baddela <sebaddel@xxxxxxxxx>
Reviewed-by: Arulprabhu Ponnusamy <arulponn@xxxxxxxxx>
Reviewed-by: Gian Carlo Boffa <gcboffa@xxxxxxxxx>
Reviewed-by: Arun Easi <aeasi@xxxxxxxxx>
Signed-off-by: Karan Tilak Kumar <kartilak@xxxxxxxxx>
---
drivers/scsi/fnic/fnic_nvme.c | 2 +-
drivers/scsi/fnic/fnic_nvme.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/fnic/fnic_nvme.c b/drivers/scsi/fnic/fnic_nvme.c
index 8794360f2adf..b237948dcafd 100644
--- a/drivers/scsi/fnic/fnic_nvme.c
+++ b/drivers/scsi/fnic/fnic_nvme.c
@@ -22,7 +22,7 @@
#include "fnic_trace.h"
#include "fdls_fc.h"
-#if IS_ENABLED(CONFIG_NVME_FC)
+#if IS_REACHABLE(CONFIG_NVME_FC)
static bool nvfnic_ls_req_cleanup(struct fnic_iport_s *iport,
struct nvmefc_ls_req *lsreq,
diff --git a/drivers/scsi/fnic/fnic_nvme.h b/drivers/scsi/fnic/fnic_nvme.h
index 5e897908337c..c05908b68e36 100644
--- a/drivers/scsi/fnic/fnic_nvme.h
+++ b/drivers/scsi/fnic/fnic_nvme.h
@@ -61,7 +61,7 @@ struct nvfnic_ls_req {
unsigned int flags;
};
-#if IS_ENABLED(CONFIG_NVME_FC)
+#if IS_REACHABLE(CONFIG_NVME_FC)
int nvfnic_nvme_io_done_handler(void *arg);
struct fnic_io_req *nvfnic_find_io_req_by_tag(struct fnic *fnic, uint16_t tag);
void nvfnic_reset_fcpio_tag_pool(struct fnic_iport_s *iport);
--
2.47.1