lib/crc: Drop inline from all *_mod_init_arch() functions
Subsystems (2)
Eric Biggers
maintainerPATCH 1/1 lib/crc: Drop inline from all *_mod_init_arch() functions
Drop 'inline' from all the *_mod_init_arch() functions so that the compiler will warn about any bugs where they are unused due to not being wired up properly. (There are no such bugs currently, so this just establishes a more robust convention for the future. Of course, these functions also tend to get inlined anyway, regardless of the keyword.)
--- lib/crc/arm/crc-t10dif.h | 2 +- lib/crc/arm/crc32.h | 2 +- lib/crc/arm64/crc-t10dif.h | 2 +- lib/crc/loongarch/crc32.h | 2 +- lib/crc/mips/crc32.h | 2 +- lib/crc/powerpc/crc-t10dif.h | 2 +- lib/crc/powerpc/crc32.h | 2 +- lib/crc/sparc/crc32.h | 2 +- lib/crc/x86/crc-t10dif.h | 2 +- lib/crc/x86/crc32.h | 2 +- lib/crc/x86/crc64.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-)
lib/crc/arm/crc-t10dif.h +1 -1
@@ -43,11 +43,11 @@ static inline u16 crc_t10dif_arch(u16 crc, const u8 *data, size_t length) }return crc_t10dif_generic (crc, data, length); }#define crc_t10dif_mod_init_arch crc_t10dif_mod_init_arch -static inline void crc_t10dif_mod_init_arch (void ) +static void crc_t10dif_mod_init_arch (void ) {if (elf_hwcap &HWCAP_NEON ) {static_branch_enable (&have_neon);if (elf_hwcap2 &HWCAP2_PMULL )static_branch_enable (&have_pmull);
lib/crc/arm/crc32.h +1 -1
@@ -83,11 +83,11 @@ static inline u32 crc32c_arch(u32 crc, const u8 *p, size_t len) }#define crc32_be_arch crc32_be_base/* not implemented on this arch */ #define crc32_mod_init_arch crc32_mod_init_arch -static inline void crc32_mod_init_arch (void ) +static void crc32_mod_init_arch (void ) {if (elf_hwcap2 &HWCAP2_CRC32 )static_branch_enable (&have_crc32);if (elf_hwcap2 &HWCAP2_PMULL )static_branch_enable (&have_pmull);
lib/crc/arm64/crc-t10dif.h +1 -1
@@ -45,11 +45,11 @@ static inline u16 crc_t10dif_arch(u16 crc, const u8 *data, size_t length) }return crc_t10dif_generic (crc, data, length); }#define crc_t10dif_mod_init_arch crc_t10dif_mod_init_arch -static inline void crc_t10dif_mod_init_arch (void ) +static void crc_t10dif_mod_init_arch (void ) {if (cpu_have_named_feature (ASIMD )) {static_branch_enable (&have_asimd);if (cpu_have_named_feature (PMULL ))static_branch_enable (&have_pmull);
lib/crc/loongarch/crc32.h +1 -1
@@ -99,11 +99,11 @@ static inline u32 crc32c_arch(u32 crc, const u8 *p, size_t len) }#define crc32_be_arch crc32_be_base/* not implemented on this arch */ #define crc32_mod_init_arch crc32_mod_init_arch -static inline void crc32_mod_init_arch (void ) +static void crc32_mod_init_arch (void ) {if (cpu_has_crc32)static_branch_enable (&have_crc32); }
lib/crc/mips/crc32.h +1 -1
@@ -146,11 +146,11 @@ static inline u32 crc32c_arch(u32 crc, const u8 *p, size_t len) }#define crc32_be_arch crc32_be_base/* not implemented on this arch */ #define crc32_mod_init_arch crc32_mod_init_arch -static inline void crc32_mod_init_arch (void ) +static void crc32_mod_init_arch (void ) {if (cpu_have_feature (cpu_feature (MIPS_CRC32 )))static_branch_enable (&have_crc32); }
lib/crc/powerpc/crc-t10dif.h +1 -1
@@ -59,11 +59,11 @@ static inline u16 crc_t10dif_arch(u16 crci, const u8 *p, size_t len)return crc &0xffff ; }#define crc_t10dif_mod_init_arch crc_t10dif_mod_init_arch -static inline void crc_t10dif_mod_init_arch (void ) +static void crc_t10dif_mod_init_arch (void ) {if (cpu_has_feature (CPU_FTR_ARCH_207S ) && (cur_cpu_spec->cpu_user_features2 &PPC_FEATURE2_VEC_CRYPTO ))static_branch_enable (&have_vec_crypto); }
lib/crc/powerpc/crc32.h +1 -1
@@ -52,11 +52,11 @@ static inline u32 crc32c_arch(u32 crc, const u8 *p, size_t len)return crc; }#define crc32_mod_init_arch crc32_mod_init_arch -static inline void crc32_mod_init_arch (void ) +static void crc32_mod_init_arch (void ) {if (cpu_has_feature (CPU_FTR_ARCH_207S ) && (cur_cpu_spec->cpu_user_features2 &PPC_FEATURE2_VEC_CRYPTO ))static_branch_enable (&have_vec_crypto); }
lib/crc/sparc/crc32.h +1 -1
@@ -42,11 +42,11 @@ static inline u32 crc32c_arch(u32 crc, const u8 *data, size_t len) crc =crc32c_base (crc, data, len);return crc; }#define crc32_mod_init_arch crc32_mod_init_arch -static inline void crc32_mod_init_arch (void ) +static void crc32_mod_init_arch (void ) {unsigned long cfr;if (!(sparc64_elf_hwcap &HWCAP_SPARC_CRYPTO ))return ;
lib/crc/x86/crc-t10dif.h +1 -1
@@ -17,11 +17,11 @@ static inline u16 crc_t10dif_arch(u16 crc, const u8 *p, size_t len) have_pclmulqdq);return crc_t10dif_generic (crc, p, len); }#define crc_t10dif_mod_init_arch crc_t10dif_mod_init_arch -static inline void crc_t10dif_mod_init_arch (void ) +static void crc_t10dif_mod_init_arch (void ) {if (boot_cpu_has (X86_FEATURE_PCLMULQDQ )) {static_branch_enable (&have_pclmulqdq);if (have_vpclmul ()) {if (have_avx512 ())
lib/crc/x86/crc32.h +1 -1
@@ -104,11 +104,11 @@ static inline u32 crc32c_arch(u32 crc, const u8 *p, size_t len) }#define crc32_be_arch crc32_be_base/* not implemented on this arch */ #define crc32_mod_init_arch crc32_mod_init_arch -static inline void crc32_mod_init_arch (void ) +static void crc32_mod_init_arch (void ) {if (boot_cpu_has (X86_FEATURE_XMM4_2 ))static_branch_enable (&have_crc32);if (boot_cpu_has (X86_FEATURE_PCLMULQDQ )) {static_branch_enable (&have_pclmulqdq);
lib/crc/x86/crc64.h +1 -1
@@ -25,11 +25,11 @@ static inline u64 crc64_nvme_arch(u64 crc, const u8 *p, size_t len) have_pclmulqdq);return crc64_nvme_generic (crc, p, len); }#define crc64_mod_init_arch crc64_mod_init_arch -static inline void crc64_mod_init_arch (void ) +static void crc64_mod_init_arch (void ) {if (boot_cpu_has (X86_FEATURE_PCLMULQDQ )) {static_branch_enable (&have_pclmulqdq);if (have_vpclmul ()) {if (have_avx512 ()) {
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
Signature · 1 line
2.50.1
Quoted 7 lines · Eric Biggers
Drop 'inline' from all the
*_mod_init_arch()functions so that the compiler will warn about any bugs where they are unused due to not being wired up properly. (There are no such bugs currently, so this just establishes a more robust convention for the future. Of course, these functions also tend to get inlined anyway, regardless of the keyword.)Signed-off-by Eric Biggers <[email protected]>
Quoted 13 lines
--- lib/crc/arm/crc-t10dif.h | 2 +- lib/crc/arm/crc32.h | 2 +- lib/crc/arm64/crc-t10dif.h | 2 +- lib/crc/loongarch/crc32.h | 2 +- lib/crc/mips/crc32.h | 2 +- lib/crc/powerpc/crc-t10dif.h | 2 +- lib/crc/powerpc/crc32.h | 2 +- lib/crc/sparc/crc32.h | 2 +- lib/crc/x86/crc-t10dif.h | 2 +- lib/crc/x86/crc32.h | 2 +- lib/crc/x86/crc64.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-)
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=crc-next
- Eric