Skip to content

Commit 648c7fb

Browse files
committed
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/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 46e3311 commit 648c7fb

File tree

11 files changed

+11
-11
lines changed

11 files changed

+11
-11
lines changed

arch/arm/lib/crc-t10dif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static int __init crc_t10dif_arm_init(void)
6060
}
6161
return 0;
6262
}
63-
arch_initcall(crc_t10dif_arm_init);
63+
subsys_initcall(crc_t10dif_arm_init);
6464

6565
static void __exit crc_t10dif_arm_exit(void)
6666
{

arch/arm/lib/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static int __init crc32_arm_init(void)
103103
static_branch_enable(&have_pmull);
104104
return 0;
105105
}
106-
arch_initcall(crc32_arm_init);
106+
subsys_initcall(crc32_arm_init);
107107

108108
static void __exit crc32_arm_exit(void)
109109
{

arch/arm64/lib/crc-t10dif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static int __init crc_t10dif_arm64_init(void)
6161
}
6262
return 0;
6363
}
64-
arch_initcall(crc_t10dif_arm64_init);
64+
subsys_initcall(crc_t10dif_arm64_init);
6565

6666
static void __exit crc_t10dif_arm64_exit(void)
6767
{

arch/loongarch/lib/crc32-loongarch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int __init crc32_loongarch_init(void)
114114
static_branch_enable(&have_crc32);
115115
return 0;
116116
}
117-
arch_initcall(crc32_loongarch_init);
117+
subsys_initcall(crc32_loongarch_init);
118118

119119
static void __exit crc32_loongarch_exit(void)
120120
{

arch/mips/lib/crc32-mips.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int __init crc32_mips_init(void)
163163
static_branch_enable(&have_crc32);
164164
return 0;
165165
}
166-
arch_initcall(crc32_mips_init);
166+
subsys_initcall(crc32_mips_init);
167167

168168
static void __exit crc32_mips_exit(void)
169169
{

arch/powerpc/lib/crc-t10dif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int __init crc_t10dif_powerpc_init(void)
7171
static_branch_enable(&have_vec_crypto);
7272
return 0;
7373
}
74-
arch_initcall(crc_t10dif_powerpc_init);
74+
subsys_initcall(crc_t10dif_powerpc_init);
7575

7676
static void __exit crc_t10dif_powerpc_exit(void)
7777
{

arch/powerpc/lib/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int __init crc32_powerpc_init(void)
7272
static_branch_enable(&have_vec_crypto);
7373
return 0;
7474
}
75-
arch_initcall(crc32_powerpc_init);
75+
subsys_initcall(crc32_powerpc_init);
7676

7777
static void __exit crc32_powerpc_exit(void)
7878
{

arch/sparc/lib/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int __init crc32_sparc_init(void)
7474
pr_info("Using sparc64 crc32c opcode optimized CRC32C implementation\n");
7575
return 0;
7676
}
77-
arch_initcall(crc32_sparc_init);
77+
subsys_initcall(crc32_sparc_init);
7878

7979
static void __exit crc32_sparc_exit(void)
8080
{

arch/x86/lib/crc-t10dif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static int __init crc_t10dif_x86_init(void)
2929
}
3030
return 0;
3131
}
32-
arch_initcall(crc_t10dif_x86_init);
32+
subsys_initcall(crc_t10dif_x86_init);
3333

3434
static void __exit crc_t10dif_x86_exit(void)
3535
{

arch/x86/lib/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static int __init crc32_x86_init(void)
8888
}
8989
return 0;
9090
}
91-
arch_initcall(crc32_x86_init);
91+
subsys_initcall(crc32_x86_init);
9292

9393
static void __exit crc32_x86_exit(void)
9494
{

0 commit comments

Comments
 (0)