[PATCH] nvme-auth: fix compilation warning when CONFIG_NVME_AUTH is not set

Sagi Grimberg sagi at grimberg.me
Tue Nov 15 06:35:32 PST 2022


init/exit functions should be empty static inline stubs when
CONFIG_NVME_AUTH is not set.

Reported-by: kernel test robot <lkp at intel.com>
Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/nvme.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 357fa7330bd9..a50b0743728e 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -1058,11 +1058,11 @@ int nvme_auth_negotiate(struct nvme_ctrl *ctrl, int qid);
 int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid);
 void nvme_auth_free(struct nvme_ctrl *ctrl);
 #else
-int __init nvme_init_auth(void)
+static inline int nvme_init_auth(void)
 {
 	return 0;
 }
-void __exit nvme_exit_auth(void) {};
+static inline void nvme_exit_auth(void) {};
 static inline void nvme_auth_init_ctrl(struct nvme_ctrl *ctrl) {};
 static inline void nvme_auth_stop(struct nvme_ctrl *ctrl) {};
 static inline int nvme_auth_negotiate(struct nvme_ctrl *ctrl, int qid)
-- 
2.34.1




More information about the Linux-nvme mailing list