Skip to content

Commit 15d90a5

Browse files
committed
Merge tag 'crc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux
Pull CRC updates from Eric Biggers: "Cleanups for the kernel's CRC (cyclic redundancy check) code: - Use __ro_after_init where appropriate - Remove unnecessary static_key on s390 - Rename some source code files - Rename the crc32 and crc32c crypto API modules - Use subsys_initcall instead of arch_initcall - Restore maintainers for crc_kunit.c - Fold crc16_byte() into crc16.c - Add some SPDX license identifiers" * tag 'crc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: lib/crc32: add SPDX license identifier lib/crc16: unexport crc16_table and crc16_byte() w1: ds2406: use crc16() instead of crc16_byte() loop MAINTAINERS: add crc_kunit.c back to CRC LIBRARY lib/crc: make arch-optimized code use subsys_initcall crypto: crc32 - remove "generic" from file and module names x86/crc: drop "glue" from filenames sparc/crc: drop "glue" from filenames s390/crc: drop "glue" from filenames powerpc/crc: rename crc32-vpmsum_core.S to crc-vpmsum-template.S powerpc/crc: drop "glue" from filenames arm64/crc: drop "glue" from filenames arm/crc: drop "glue" from filenames s390/crc32: Remove no-op module init and exit functions s390/crc32: Remove have_vxrs static key lib/crc: make the CPU feature static keys __ro_after_init
2 parents 14f19dc + 289c99b commit 15d90a5

32 files changed

+59
-92
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6263,6 +6263,7 @@ F: Documentation/staging/crc*
62636263
F: arch/*/lib/crc*
62646264
F: include/linux/crc*
62656265
F: lib/crc*
6266+
F: lib/tests/crc_kunit.c
62666267
F: scripts/gen-crc-consts.py
62676268

62686269
CREATIVE SB0540

arch/arm/lib/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endif
4747
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
4848

4949
obj-$(CONFIG_CRC32_ARCH) += crc32-arm.o
50-
crc32-arm-y := crc32-glue.o crc32-core.o
50+
crc32-arm-y := crc32.o crc32-core.o
5151

5252
obj-$(CONFIG_CRC_T10DIF_ARCH) += crc-t10dif-arm.o
53-
crc-t10dif-arm-y := crc-t10dif-glue.o crc-t10dif-core.o
53+
crc-t10dif-arm-y := crc-t10dif.o crc-t10dif-core.o

arch/arm/lib/crc-t10dif-glue.c renamed to arch/arm/lib/crc-t10dif.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include <asm/neon.h>
1717
#include <asm/simd.h>
1818

19-
static DEFINE_STATIC_KEY_FALSE(have_neon);
20-
static DEFINE_STATIC_KEY_FALSE(have_pmull);
19+
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
20+
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pmull);
2121

2222
#define CRC_T10DIF_PMULL_CHUNK_SIZE 16U
2323

@@ -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-glue.c renamed to arch/arm/lib/crc32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#include <asm/neon.h>
1919
#include <asm/simd.h>
2020

21-
static DEFINE_STATIC_KEY_FALSE(have_crc32);
22-
static DEFINE_STATIC_KEY_FALSE(have_pmull);
21+
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32);
22+
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pmull);
2323

2424
#define PMULL_MIN_LEN 64 /* min size of buffer for pmull functions */
2525

@@ -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/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ endif
1414
lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
1515

1616
obj-$(CONFIG_CRC32_ARCH) += crc32-arm64.o
17-
crc32-arm64-y := crc32.o crc32-glue.o
17+
crc32-arm64-y := crc32.o crc32-core.o
1818

1919
obj-$(CONFIG_CRC_T10DIF_ARCH) += crc-t10dif-arm64.o
20-
crc-t10dif-arm64-y := crc-t10dif-glue.o crc-t10dif-core.o
20+
crc-t10dif-arm64-y := crc-t10dif.o crc-t10dif-core.o
2121

2222
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
2323

arch/arm64/lib/crc-t10dif-glue.c renamed to arch/arm64/lib/crc-t10dif.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include <asm/neon.h>
1818
#include <asm/simd.h>
1919

20-
static DEFINE_STATIC_KEY_FALSE(have_asimd);
21-
static DEFINE_STATIC_KEY_FALSE(have_pmull);
20+
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_asimd);
21+
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pmull);
2222

2323
#define CRC_T10DIF_PMULL_CHUNK_SIZE 16U
2424

@@ -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
{
File renamed without changes.
File renamed without changes.

arch/loongarch/lib/crc32-loongarch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ do { \
2626
#define CRC32(crc, value, size) _CRC32(crc, value, size, crc)
2727
#define CRC32C(crc, value, size) _CRC32(crc, value, size, crcc)
2828

29-
static DEFINE_STATIC_KEY_FALSE(have_crc32);
29+
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32);
3030

3131
u32 crc32_le_arch(u32 crc, const u8 *p, size_t len)
3232
{
@@ -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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ do { \
6262
#define CRC32C(crc, value, size) \
6363
_CRC32(crc, value, size, crc32c)
6464

65-
static DEFINE_STATIC_KEY_FALSE(have_crc32);
65+
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32);
6666

6767
u32 crc32_le_arch(u32 crc, const u8 *p, size_t len)
6868
{
@@ -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
{

0 commit comments

Comments
 (0)