diff options
-rw-r--r-- | arch/s390/Kconfig | 1 | ||||
-rw-r--r-- | arch/s390/lib/Makefile | 3 | ||||
-rw-r--r-- | lib/crc/Kconfig | 1 | ||||
-rw-r--r-- | lib/crc/Makefile | 1 | ||||
-rw-r--r-- | lib/crc/s390/crc32-vx.h (renamed from arch/s390/lib/crc32-vx.h) | 0 | ||||
-rw-r--r-- | lib/crc/s390/crc32.h (renamed from arch/s390/lib/crc32.c) | 16 | ||||
-rw-r--r-- | lib/crc/s390/crc32be-vx.c (renamed from arch/s390/lib/crc32be-vx.c) | 0 | ||||
-rw-r--r-- | lib/crc/s390/crc32le-vx.c (renamed from arch/s390/lib/crc32le-vx.c) | 0 |
8 files changed, 5 insertions, 17 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 0c16dc443e2f..22b90f6aa1a0 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -75,7 +75,6 @@ config S390 select ARCH_ENABLE_MEMORY_HOTREMOVE select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 select ARCH_HAS_CPU_FINALIZE_INIT - select ARCH_HAS_CRC32 select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DEBUG_VIRTUAL select ARCH_HAS_DEBUG_VM_PGTABLE diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile index cd35cdbfa871..7c8583d46eca 100644 --- a/arch/s390/lib/Makefile +++ b/arch/s390/lib/Makefile @@ -25,6 +25,3 @@ obj-$(CONFIG_S390_MODULES_SANITY_TEST_HELPERS) += test_modules_helpers.o lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o obj-$(CONFIG_EXPOLINE_EXTERN) += expoline.o - -obj-$(CONFIG_CRC32_ARCH) += crc32-s390.o -crc32-s390-y := crc32.o crc32le-vx.o crc32be-vx.o diff --git a/lib/crc/Kconfig b/lib/crc/Kconfig index b8894c451aca..c8d540a6b04a 100644 --- a/lib/crc/Kconfig +++ b/lib/crc/Kconfig @@ -74,6 +74,7 @@ config CRC32_ARCH default y if MIPS && CPU_MIPSR6 default y if PPC64 && ALTIVEC default y if RISCV && RISCV_ISA_ZBC + default y if S390 config CRC64 tristate diff --git a/lib/crc/Makefile b/lib/crc/Makefile index 190f889adf55..bec58266251f 100644 --- a/lib/crc/Makefile +++ b/lib/crc/Makefile @@ -27,6 +27,7 @@ crc32-$(CONFIG_ARM) += arm/crc32-core.o crc32-$(CONFIG_ARM64) += arm64/crc32-core.o crc32-$(CONFIG_PPC) += powerpc/crc32c-vpmsum_asm.o crc32-$(CONFIG_RISCV) += riscv/crc32_lsb.o riscv/crc32_msb.o +crc32-$(CONFIG_S390) += s390/crc32le-vx.o s390/crc32be-vx.o endif obj-$(CONFIG_CRC64) += crc64.o diff --git a/arch/s390/lib/crc32-vx.h b/lib/crc/s390/crc32-vx.h index 652c96e1a822..652c96e1a822 100644 --- a/arch/s390/lib/crc32-vx.h +++ b/lib/crc/s390/crc32-vx.h diff --git a/arch/s390/lib/crc32.c b/lib/crc/s390/crc32.h index 3c4b344417c1..59c8983d428b 100644 --- a/arch/s390/lib/crc32.c +++ b/lib/crc/s390/crc32.h @@ -5,12 +5,8 @@ * Copyright IBM Corp. 2015 * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> */ -#define KMSG_COMPONENT "crc32-vx" -#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt -#include <linux/module.h> #include <linux/cpufeature.h> -#include <linux/crc32.h> #include <asm/fpu.h> #include "crc32-vx.h" @@ -27,7 +23,7 @@ * operations of VECTOR LOAD MULTIPLE instructions. */ #define DEFINE_CRC32_VX(___fname, ___crc32_vx, ___crc32_sw) \ - u32 ___fname(u32 crc, const u8 *data, size_t datalen) \ + static inline u32 ___fname(u32 crc, const u8 *data, size_t datalen) \ { \ unsigned long prealign, aligned, remaining; \ DECLARE_KERNEL_FPU_ONSTACK16(vxstate); \ @@ -54,14 +50,13 @@ crc = ___crc32_sw(crc, data + aligned, remaining); \ \ return crc; \ - } \ - EXPORT_SYMBOL(___fname); + } DEFINE_CRC32_VX(crc32_le_arch, crc32_le_vgfm_16, crc32_le_base) DEFINE_CRC32_VX(crc32_be_arch, crc32_be_vgfm_16, crc32_be_base) DEFINE_CRC32_VX(crc32c_arch, crc32c_le_vgfm_16, crc32c_base) -u32 crc32_optimizations(void) +static inline u32 crc32_optimizations_arch(void) { if (cpu_has_vx()) { return CRC32_LE_OPTIMIZATION | @@ -70,8 +65,3 @@ u32 crc32_optimizations(void) } return 0; } -EXPORT_SYMBOL(crc32_optimizations); - -MODULE_AUTHOR("Hendrik Brueckner <brueckner@linux.vnet.ibm.com>"); -MODULE_DESCRIPTION("CRC-32 algorithms using z/Architecture Vector Extension Facility"); -MODULE_LICENSE("GPL"); diff --git a/arch/s390/lib/crc32be-vx.c b/lib/crc/s390/crc32be-vx.c index fed7c9c70d05..fed7c9c70d05 100644 --- a/arch/s390/lib/crc32be-vx.c +++ b/lib/crc/s390/crc32be-vx.c diff --git a/arch/s390/lib/crc32le-vx.c b/lib/crc/s390/crc32le-vx.c index 2f629f394df7..2f629f394df7 100644 --- a/arch/s390/lib/crc32le-vx.c +++ b/lib/crc/s390/crc32le-vx.c |