Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/crc: make the CPU feature static keys __ro_after_init

All of the CRC library's CPU feature static_keys are initialized by
initcalls and never change afterwards, so there's no need for them to be
in the regular .data section. Put them in .data..ro_after_init instead.

Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Heiko Carstens <hca@linux.ibm.com> # s390
Link: https://lore.kernel.org/r/20250413154350.10819-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>

+16 -16
+2 -2
arch/arm/lib/crc-t10dif-glue.c
··· 16 16 #include <asm/neon.h> 17 17 #include <asm/simd.h> 18 18 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); 21 21 22 22 #define CRC_T10DIF_PMULL_CHUNK_SIZE 16U 23 23
+2 -2
arch/arm/lib/crc32-glue.c
··· 18 18 #include <asm/neon.h> 19 19 #include <asm/simd.h> 20 20 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); 23 23 24 24 #define PMULL_MIN_LEN 64 /* min size of buffer for pmull functions */ 25 25
+2 -2
arch/arm64/lib/crc-t10dif-glue.c
··· 17 17 #include <asm/neon.h> 18 18 #include <asm/simd.h> 19 19 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); 22 22 23 23 #define CRC_T10DIF_PMULL_CHUNK_SIZE 16U 24 24
+1 -1
arch/loongarch/lib/crc32-loongarch.c
··· 26 26 #define CRC32(crc, value, size) _CRC32(crc, value, size, crc) 27 27 #define CRC32C(crc, value, size) _CRC32(crc, value, size, crcc) 28 28 29 - static DEFINE_STATIC_KEY_FALSE(have_crc32); 29 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32); 30 30 31 31 u32 crc32_le_arch(u32 crc, const u8 *p, size_t len) 32 32 {
+1 -1
arch/mips/lib/crc32-mips.c
··· 62 62 #define CRC32C(crc, value, size) \ 63 63 _CRC32(crc, value, size, crc32c) 64 64 65 - static DEFINE_STATIC_KEY_FALSE(have_crc32); 65 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32); 66 66 67 67 u32 crc32_le_arch(u32 crc, const u8 *p, size_t len) 68 68 {
+1 -1
arch/powerpc/lib/crc-t10dif-glue.c
··· 21 21 22 22 #define VECTOR_BREAKPOINT 64 23 23 24 - static DEFINE_STATIC_KEY_FALSE(have_vec_crypto); 24 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_vec_crypto); 25 25 26 26 u32 __crct10dif_vpmsum(u32 crc, unsigned char const *p, size_t len); 27 27
+1 -1
arch/powerpc/lib/crc32-glue.c
··· 13 13 14 14 #define VECTOR_BREAKPOINT 512 15 15 16 - static DEFINE_STATIC_KEY_FALSE(have_vec_crypto); 16 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_vec_crypto); 17 17 18 18 u32 __crc32c_vpmsum(u32 crc, const u8 *p, size_t len); 19 19
+1 -1
arch/s390/lib/crc32-glue.c
··· 18 18 #define VX_ALIGNMENT 16L 19 19 #define VX_ALIGN_MASK (VX_ALIGNMENT - 1) 20 20 21 - static DEFINE_STATIC_KEY_FALSE(have_vxrs); 21 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_vxrs); 22 22 23 23 /* 24 24 * DEFINE_CRC32_VX() - Define a CRC-32 function using the vector extension
+1 -1
arch/sparc/lib/crc32_glue.c
··· 17 17 #include <asm/pstate.h> 18 18 #include <asm/elf.h> 19 19 20 - static DEFINE_STATIC_KEY_FALSE(have_crc32c_opcode); 20 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32c_opcode); 21 21 22 22 u32 crc32_le_arch(u32 crc, const u8 *data, size_t len) 23 23 {
+1 -1
arch/x86/lib/crc-t10dif-glue.c
··· 9 9 #include <linux/module.h> 10 10 #include "crc-pclmul-template.h" 11 11 12 - static DEFINE_STATIC_KEY_FALSE(have_pclmulqdq); 12 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pclmulqdq); 13 13 14 14 DECLARE_CRC_PCLMUL_FUNCS(crc16_msb, u16); 15 15
+2 -2
arch/x86/lib/crc32-glue.c
··· 11 11 #include <linux/module.h> 12 12 #include "crc-pclmul-template.h" 13 13 14 - static DEFINE_STATIC_KEY_FALSE(have_crc32); 15 - static DEFINE_STATIC_KEY_FALSE(have_pclmulqdq); 14 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32); 15 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pclmulqdq); 16 16 17 17 DECLARE_CRC_PCLMUL_FUNCS(crc32_lsb, u32); 18 18
+1 -1
arch/x86/lib/crc64-glue.c
··· 9 9 #include <linux/module.h> 10 10 #include "crc-pclmul-template.h" 11 11 12 - static DEFINE_STATIC_KEY_FALSE(have_pclmulqdq); 12 + static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pclmulqdq); 13 13 14 14 DECLARE_CRC_PCLMUL_FUNCS(crc64_msb, u64); 15 15 DECLARE_CRC_PCLMUL_FUNCS(crc64_lsb, u64);