summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.ibm.com>2024-10-25 12:34:31 +0200
committerHeiko Carstens <hca@linux.ibm.com>2024-10-29 11:17:17 +0100
commiteb37a9aea64d1b3b2944679dc6b85b3bb84053cd (patch)
tree0627cb21a9046a2150cf6430b601be1ea3f4c145 /drivers
parent1bcf8d9a0c3d8b0c706f52c1cb0d523da7dd6361 (diff)
downloadlinux-stable-eb37a9aea64d1b3b2944679dc6b85b3bb84053cd.tar.gz
linux-stable-eb37a9aea64d1b3b2944679dc6b85b3bb84053cd.tar.bz2
linux-stable-eb37a9aea64d1b3b2944679dc6b85b3bb84053cd.zip
s390/pkey: Build module name array selectively based on kernel config options
There is a static array of pkey handler kernel module names used in case the pkey_handler_request_modules() is invoked. This static array is walked through and if the module is not already loaded a module_request() is performed. This patch reworks the code to instead of unconditionally building up a list of module names into the array, only the pkey handler modules available based on the current kernel config options are inserted. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Holger Dengler <dengler@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/crypto/pkey_base.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/s390/crypto/pkey_base.c b/drivers/s390/crypto/pkey_base.c
index fea243322838..2fc48214336d 100644
--- a/drivers/s390/crypto/pkey_base.c
+++ b/drivers/s390/crypto/pkey_base.c
@@ -304,7 +304,16 @@ void pkey_handler_request_modules(void)
{
#ifdef CONFIG_MODULES
static const char * const pkey_handler_modules[] = {
- "pkey_cca", "pkey_ep11", "pkey_pckmo" };
+#if IS_MODULE(CONFIG_PKEY_CCA)
+ "pkey_cca",
+#endif
+#if IS_MODULE(CONFIG_PKEY_EP11)
+ "pkey_ep11",
+#endif
+#if IS_MODULE(CONFIG_PKEY_PCKMO)
+ "pkey_pckmo",
+#endif
+ };
int i;
for (i = 0; i < ARRAY_SIZE(pkey_handler_modules); i++) {