From 637be9183e0475c430fc77162c222bcaab887989 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Sat, 8 May 2021 00:07:46 +0200 Subject: asm-generic: use asm-generic/unaligned.h for most architectures There are several architectures that just duplicate the contents of asm-generic/unaligned.h, so change those over to use the file directly, to make future modifications easier. The exceptions are: - arm32 sets HAVE_EFFICIENT_UNALIGNED_ACCESS, but wants the unaligned-struct version - ppc64le disables HAVE_EFFICIENT_UNALIGNED_ACCESS but includes the access-ok version - most m68k also uses the access-ok version without setting HAVE_EFFICIENT_UNALIGNED_ACCESS. - sh4a has a custom inline asm version - openrisc is the only one using the memmove version that generally leads to worse code. Signed-off-by: Arnd Bergmann Reviewed-by: Thomas Gleixner Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven --- arch/m68k/include/asm/unaligned.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'arch/m68k/include') diff --git a/arch/m68k/include/asm/unaligned.h b/arch/m68k/include/asm/unaligned.h index 98c8930d3d35..84e437337344 100644 --- a/arch/m68k/include/asm/unaligned.h +++ b/arch/m68k/include/asm/unaligned.h @@ -2,15 +2,8 @@ #ifndef _ASM_M68K_UNALIGNED_H #define _ASM_M68K_UNALIGNED_H - #ifdef CONFIG_CPU_HAS_NO_UNALIGNED -#include -#include -#include - -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be - +#include #else /* * The m68k can do unaligned accesses itself. -- cgit From 3aec1db05d1ba631311beca4715655591a9e17d5 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Sat, 8 May 2021 00:07:49 +0200 Subject: m68k: select CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS All supported CPUs other than the old dragonball and in theory other 68000 derivatives use the include/linux/unaligned/access_ok.h implementation for accessing unaligned variables, so presumably this works everywhere. However, m68k never selects CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS, so none of the other conditionals in the kernel get the optimized implementation. Select this based on CPU_HAS_NO_UNALIGNED to make the two settings always match, and then use the generic version of the header. Signed-off-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven --- arch/m68k/include/asm/unaligned.h | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 arch/m68k/include/asm/unaligned.h (limited to 'arch/m68k/include') diff --git a/arch/m68k/include/asm/unaligned.h b/arch/m68k/include/asm/unaligned.h deleted file mode 100644 index 84e437337344..000000000000 --- a/arch/m68k/include/asm/unaligned.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_M68K_UNALIGNED_H -#define _ASM_M68K_UNALIGNED_H - -#ifdef CONFIG_CPU_HAS_NO_UNALIGNED -#include -#else -/* - * The m68k can do unaligned accesses itself. - */ -#include -#include - -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be - -#endif - -#endif /* _ASM_M68K_UNALIGNED_H */ -- cgit