Commit 6affe08a authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Keith Busch

nvme: common: make keyring and auth separate modules

When only the keyring module is included but auth is not, modpost
complains about the lack of a module license tag:

ERROR: modpost: missing MODULE_LICENSE() in drivers/nvme/common/nvme-common.o

Address this by making both modules buildable standalone,
removing the now unnecessary CONFIG_NVME_COMMON symbol
in the process.

Also, now that NVME_KEYRING config symbol can be either a module or
built-in, the stubs need to check for '#if IS_ENABLED' rather than a
simple '#ifdef'.

Fixes: 9d77eb52 ("nvme-keyring: register '.nvme' keyring")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 4733b65d
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_NVME_COMMON) += common/ obj-y += common/
obj-y += host/ obj-y += host/
obj-y += target/ obj-y += target/
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
config NVME_COMMON
tristate
config NVME_KEYRING config NVME_KEYRING
bool tristate
select KEYS select KEYS
config NVME_AUTH config NVME_AUTH
bool tristate
select CRYPTO select CRYPTO
select CRYPTO_HMAC select CRYPTO_HMAC
select CRYPTO_SHA256 select CRYPTO_SHA256
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
ccflags-y += -I$(src) ccflags-y += -I$(src)
obj-$(CONFIG_NVME_COMMON) += nvme-common.o obj-$(CONFIG_NVME_AUTH) += nvme-auth.o
obj-$(CONFIG_NVME_KEYRING) += nvme-keyring.o
nvme-common-$(CONFIG_NVME_AUTH) += auth.o nvme-auth-y += auth.o
nvme-common-$(CONFIG_NVME_KEYRING) += keyring.o nvme-keyring-y += keyring.o
...@@ -180,3 +180,5 @@ void nvme_keyring_exit(void) ...@@ -180,3 +180,5 @@ void nvme_keyring_exit(void)
key_put(nvme_keyring); key_put(nvme_keyring);
} }
EXPORT_SYMBOL_GPL(nvme_keyring_exit); EXPORT_SYMBOL_GPL(nvme_keyring_exit);
MODULE_LICENSE("GPL v2");
...@@ -95,7 +95,6 @@ config NVME_TCP ...@@ -95,7 +95,6 @@ config NVME_TCP
config NVME_TCP_TLS config NVME_TCP_TLS
bool "NVMe over Fabrics TCP TLS encryption support" bool "NVMe over Fabrics TCP TLS encryption support"
depends on NVME_TCP depends on NVME_TCP
select NVME_COMMON
select NVME_KEYRING select NVME_KEYRING
select NET_HANDSHAKE select NET_HANDSHAKE
select KEYS select KEYS
...@@ -110,7 +109,6 @@ config NVME_TCP_TLS ...@@ -110,7 +109,6 @@ config NVME_TCP_TLS
config NVME_HOST_AUTH config NVME_HOST_AUTH
bool "NVM Express over Fabrics In-Band Authentication" bool "NVM Express over Fabrics In-Band Authentication"
depends on NVME_CORE depends on NVME_CORE
select NVME_COMMON
select NVME_AUTH select NVME_AUTH
help help
This provides support for NVMe over Fabrics In-Band Authentication. This provides support for NVMe over Fabrics In-Band Authentication.
......
...@@ -87,7 +87,6 @@ config NVME_TARGET_TCP ...@@ -87,7 +87,6 @@ config NVME_TARGET_TCP
config NVME_TARGET_TCP_TLS config NVME_TARGET_TCP_TLS
bool "NVMe over Fabrics TCP target TLS encryption support" bool "NVMe over Fabrics TCP target TLS encryption support"
depends on NVME_TARGET_TCP depends on NVME_TARGET_TCP
select NVME_COMMON
select NVME_KEYRING select NVME_KEYRING
select NET_HANDSHAKE select NET_HANDSHAKE
select KEYS select KEYS
...@@ -102,7 +101,6 @@ config NVME_TARGET_TCP_TLS ...@@ -102,7 +101,6 @@ config NVME_TARGET_TCP_TLS
config NVME_TARGET_AUTH config NVME_TARGET_AUTH
bool "NVMe over Fabrics In-band Authentication support" bool "NVMe over Fabrics In-band Authentication support"
depends on NVME_TARGET depends on NVME_TARGET
select NVME_COMMON
select NVME_AUTH select NVME_AUTH
help help
This enables support for NVMe over Fabrics In-band Authentication This enables support for NVMe over Fabrics In-band Authentication
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#ifndef _NVME_KEYRING_H #ifndef _NVME_KEYRING_H
#define _NVME_KEYRING_H #define _NVME_KEYRING_H
#ifdef CONFIG_NVME_KEYRING #if IS_ENABLED(CONFIG_NVME_KEYRING)
key_serial_t nvme_tls_psk_default(struct key *keyring, key_serial_t nvme_tls_psk_default(struct key *keyring,
const char *hostnqn, const char *subnqn); const char *hostnqn, const char *subnqn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment