[PATCH] nvme-keyring: mark nvme_dhchap_psk_hash() as static inline

Chaitanya Kulkarni ckulkarnilinux at gmail.com
Sat Nov 1 20:17:01 PDT 2025


Fix build warning when CONFIG_NVME_KEYRING is not enabled:

  include/linux/nvme-keyring.h:57:4: warning: no previous prototype for
  function 'nvme_dhchap_psk_hash' [-Wmissing-prototypes]

The nvme_dhchap_psk_hash() stub function in the #else block is missing
the 'static inline' qualifiers that all other stub functions in the same
block have. Add them to fix the warning.

Reported-by: kernel test robot <lkp at intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202511011103.e6eXLAln-lkp@intel.com/
Fixes: 8d9937531a4d ("nvme-keyring: add 'dhchap' key type")
Signed-off-by: Chaitanya Kulkarni <ckulkarnilinux at gmail.com>
---
 include/linux/nvme-keyring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/nvme-keyring.h b/include/linux/nvme-keyring.h
index 6115bf5cf346..4bdac22b3cbb 100644
--- a/include/linux/nvme-keyring.h
+++ b/include/linux/nvme-keyring.h
@@ -54,7 +54,7 @@ static inline struct key *nvme_dhchap_psk_lookup(struct key *keyring,
 {
 	return ERR_PTR(-ENOTSUPP);
 }
-u8 nvme_dhchap_psk_hash(struct key *key)
+static inline u8 nvme_dhchap_psk_hash(struct key *key)
 {
 	return 0;
 }
-- 
2.40.0




More information about the Linux-nvme mailing list