aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2025-05-09 20:59:59 -0700
committerEric Biggers <ebiggers@google.com>2025-05-09 21:02:37 -0700
commit648c7fb16f609c53d2659fefb5088af619485ab4 (patch)
treeca35137c423b2acb6411152c86fc69cd46f21e18 /arch/x86/lib
parentcrypto: crc32 - remove "generic" from file and module names (diff)
downloadlinux-648c7fb16f609c53d2659fefb5088af619485ab4.tar.gz
linux-648c7fb16f609c53d2659fefb5088af619485ab4.zip
lib/crc: make arch-optimized code use subsys_initcall
Make the architecture-optimized CRC code do its CPU feature checks in subsys_initcalls instead of arch_initcalls. This makes it consistent with arch/*/lib/crypto/ and ensures that it runs after initcalls that possibly could be a prerequisite for kernel-mode FPU, such as x86's xfd_update_static_branch() and loongarch's init_euen_mask(). Note: as far as I can tell, x86's xfd_update_static_branch() isn't *actually* needed for kernel-mode FPU. loongarch's init_euen_mask() is needed to enable save/restore of the vector registers, but loongarch doesn't yet have any CRC or crypto code that uses vector registers anyway. Regardless, let's be consistent with arch/*/lib/crypto/ and robust against any potential future dependency on an arch_initcall. Link: https://lore.kernel.org/r/20250510035959.87995-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r--arch/x86/lib/crc-t10dif.c2
-rw-r--r--arch/x86/lib/crc32.c2
-rw-r--r--arch/x86/lib/crc64.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/lib/crc-t10dif.c b/arch/x86/lib/crc-t10dif.c
index d073b3678edc..db7ce59c31ac 100644
--- a/arch/x86/lib/crc-t10dif.c
+++ b/arch/x86/lib/crc-t10dif.c
@@ -29,7 +29,7 @@ static int __init crc_t10dif_x86_init(void)
}
return 0;
}
-arch_initcall(crc_t10dif_x86_init);
+subsys_initcall(crc_t10dif_x86_init);
static void __exit crc_t10dif_x86_exit(void)
{
diff --git a/arch/x86/lib/crc32.c b/arch/x86/lib/crc32.c
index e6a6285cfca8..d09343e2cea9 100644
--- a/arch/x86/lib/crc32.c
+++ b/arch/x86/lib/crc32.c
@@ -88,7 +88,7 @@ static int __init crc32_x86_init(void)
}
return 0;
}
-arch_initcall(crc32_x86_init);
+subsys_initcall(crc32_x86_init);
static void __exit crc32_x86_exit(void)
{
diff --git a/arch/x86/lib/crc64.c b/arch/x86/lib/crc64.c
index 1214ee726c16..351a09f5813e 100644
--- a/arch/x86/lib/crc64.c
+++ b/arch/x86/lib/crc64.c
@@ -39,7 +39,7 @@ static int __init crc64_x86_init(void)
}
return 0;
}
-arch_initcall(crc64_x86_init);
+subsys_initcall(crc64_x86_init);
static void __exit crc64_x86_exit(void)
{