Skip to content

Commit 4cad671

Browse files
committed
Merge tag 'asm-generic-unaligned-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Pull asm/unaligned.h unification from Arnd Bergmann: "Unify asm/unaligned.h around struct helper The get_unaligned()/put_unaligned() helpers are traditionally architecture specific, with the two main variants being the "access-ok.h" version that assumes unaligned pointer accesses always work on a particular architecture, and the "le-struct.h" version that casts the data to a byte aligned type before dereferencing, for architectures that cannot always do unaligned accesses in hardware. Based on the discussion linked below, it appears that the access-ok version is not realiable on any architecture, but the struct version probably has no downsides. This series changes the code to use the same implementation on all architectures, addressing the few exceptions separately" Link: https://lore.kernel.org/lkml/[email protected]/ Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100363 Link: https://lore.kernel.org/lkml/[email protected]/ Link: git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git unaligned-rework-v2 Link: https://lore.kernel.org/lkml/CAHk-=whGObOKruA_bU3aPGZfoDqZM1_9wBkwREp0H0FgR-90uQ@mail.gmail.com/ * tag 'asm-generic-unaligned-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: asm-generic: simplify asm/unaligned.h asm-generic: uaccess: 1-byte access is always aligned netpoll: avoid put_unaligned() on single character mwifiex: re-fix for unaligned accesses apparmor: use get_unaligned() only for multi-byte words partitions: msdos: fix one-byte get_unaligned() asm-generic: unaligned always use struct helpers asm-generic: unaligned: remove byteshift helpers powerpc: use linux/unaligned/le_struct.h on LE power7 m68k: select CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS sh: remove unaligned access for sh4a openrisc: always use unaligned-struct header asm-generic: use asm-generic/unaligned.h for most architectures
2 parents 4062549 + 803f4e1 commit 4cad671

File tree

32 files changed

+141
-1017
lines changed

32 files changed

+141
-1017
lines changed

arch/alpha/include/asm/unaligned.h

-12
This file was deleted.

arch/arm/include/asm/unaligned.h

-27
This file was deleted.

arch/ia64/include/asm/unaligned.h

-12
This file was deleted.

arch/m68k/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ config M68K
2121
select HAVE_AOUT if MMU
2222
select HAVE_ASM_MODVERSIONS
2323
select HAVE_DEBUG_BUGVERBOSE
24+
select HAVE_EFFICIENT_UNALIGNED_ACCESS if !CPU_HAS_NO_UNALIGNED
2425
select HAVE_FUTEX_CMPXCHG if MMU && FUTEX
2526
select HAVE_IDE
2627
select HAVE_MOD_ARCH_SPECIFIC

arch/m68k/include/asm/unaligned.h

-26
This file was deleted.

arch/microblaze/include/asm/unaligned.h

-27
This file was deleted.

arch/mips/crypto/crc32-mips.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
* Copyright (C) 2018 MIPS Tech, LLC
99
*/
1010

11-
#include <linux/unaligned/access_ok.h>
1211
#include <linux/cpufeature.h>
1312
#include <linux/init.h>
1413
#include <linux/kernel.h>
1514
#include <linux/module.h>
1615
#include <linux/string.h>
1716
#include <asm/mipsregs.h>
17+
#include <asm/unaligned.h>
1818

1919
#include <crypto/internal/hash.h>
2020

arch/openrisc/include/asm/unaligned.h

-47
This file was deleted.

arch/parisc/include/asm/unaligned.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
#ifndef _ASM_PARISC_UNALIGNED_H
33
#define _ASM_PARISC_UNALIGNED_H
44

5-
#include <linux/unaligned/be_struct.h>
6-
#include <linux/unaligned/le_byteshift.h>
7-
#include <linux/unaligned/generic.h>
8-
#define get_unaligned __get_unaligned_be
9-
#define put_unaligned __put_unaligned_be
5+
#include <asm-generic/unaligned.h>
106

117
#ifdef __KERNEL__
128
struct pt_regs;

arch/powerpc/include/asm/unaligned.h

-22
This file was deleted.

0 commit comments

Comments
 (0)