Skip to content

Commit 6affe08

Browse files
arndbkeithbusch
authored andcommitted
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: 9d77eb5 ("nvme-keyring: register '.nvme' keyring") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 4733b65 commit 6affe08

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
lines changed

drivers/nvme/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

3-
obj-$(CONFIG_NVME_COMMON) += common/
3+
obj-y += common/
44
obj-y += host/
55
obj-y += target/

drivers/nvme/common/Kconfig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

3-
config NVME_COMMON
4-
tristate
5-
63
config NVME_KEYRING
7-
bool
4+
tristate
85
select KEYS
96

107
config NVME_AUTH
11-
bool
8+
tristate
129
select CRYPTO
1310
select CRYPTO_HMAC
1411
select CRYPTO_SHA256

drivers/nvme/common/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
ccflags-y += -I$(src)
44

5-
obj-$(CONFIG_NVME_COMMON) += nvme-common.o
5+
obj-$(CONFIG_NVME_AUTH) += nvme-auth.o
6+
obj-$(CONFIG_NVME_KEYRING) += nvme-keyring.o
67

7-
nvme-common-$(CONFIG_NVME_AUTH) += auth.o
8-
nvme-common-$(CONFIG_NVME_KEYRING) += keyring.o
8+
nvme-auth-y += auth.o
9+
nvme-keyring-y += keyring.o

drivers/nvme/common/keyring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,5 @@ void nvme_keyring_exit(void)
180180
key_put(nvme_keyring);
181181
}
182182
EXPORT_SYMBOL_GPL(nvme_keyring_exit);
183+
184+
MODULE_LICENSE("GPL v2");

drivers/nvme/host/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ config NVME_TCP
9595
config NVME_TCP_TLS
9696
bool "NVMe over Fabrics TCP TLS encryption support"
9797
depends on NVME_TCP
98-
select NVME_COMMON
9998
select NVME_KEYRING
10099
select NET_HANDSHAKE
101100
select KEYS
@@ -110,7 +109,6 @@ config NVME_TCP_TLS
110109
config NVME_HOST_AUTH
111110
bool "NVM Express over Fabrics In-Band Authentication"
112111
depends on NVME_CORE
113-
select NVME_COMMON
114112
select NVME_AUTH
115113
help
116114
This provides support for NVMe over Fabrics In-Band Authentication.

drivers/nvme/target/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ config NVME_TARGET_TCP
8787
config NVME_TARGET_TCP_TLS
8888
bool "NVMe over Fabrics TCP target TLS encryption support"
8989
depends on NVME_TARGET_TCP
90-
select NVME_COMMON
9190
select NVME_KEYRING
9291
select NET_HANDSHAKE
9392
select KEYS
@@ -102,7 +101,6 @@ config NVME_TARGET_TCP_TLS
102101
config NVME_TARGET_AUTH
103102
bool "NVMe over Fabrics In-band Authentication support"
104103
depends on NVME_TARGET
105-
select NVME_COMMON
106104
select NVME_AUTH
107105
help
108106
This enables support for NVMe over Fabrics In-band Authentication

include/linux/nvme-keyring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef _NVME_KEYRING_H
77
#define _NVME_KEYRING_H
88

9-
#ifdef CONFIG_NVME_KEYRING
9+
#if IS_ENABLED(CONFIG_NVME_KEYRING)
1010

1111
key_serial_t nvme_tls_psk_default(struct key *keyring,
1212
const char *hostnqn, const char *subnqn);

0 commit comments

Comments
 (0)