Skip to content

Commit

Permalink
Merge tag 'asm-generic-unaligned-5.14' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/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
  • Loading branch information
torvalds committed Jul 2, 2021
2 parents 4062549 + 803f4e1 commit 4cad671
Show file tree
Hide file tree
Showing 32 changed files with 141 additions and 1,017 deletions.
12 changes: 0 additions & 12 deletions arch/alpha/include/asm/unaligned.h

This file was deleted.

27 changes: 0 additions & 27 deletions arch/arm/include/asm/unaligned.h

This file was deleted.

12 changes: 0 additions & 12 deletions arch/ia64/include/asm/unaligned.h

This file was deleted.

1 change: 1 addition & 0 deletions arch/m68k/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ config M68K
select HAVE_AOUT if MMU
select HAVE_ASM_MODVERSIONS
select HAVE_DEBUG_BUGVERBOSE
select HAVE_EFFICIENT_UNALIGNED_ACCESS if !CPU_HAS_NO_UNALIGNED
select HAVE_FUTEX_CMPXCHG if MMU && FUTEX
select HAVE_IDE
select HAVE_MOD_ARCH_SPECIFIC
Expand Down
26 changes: 0 additions & 26 deletions arch/m68k/include/asm/unaligned.h

This file was deleted.

27 changes: 0 additions & 27 deletions arch/microblaze/include/asm/unaligned.h

This file was deleted.

2 changes: 1 addition & 1 deletion arch/mips/crypto/crc32-mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
* Copyright (C) 2018 MIPS Tech, LLC
*/

#include <linux/unaligned/access_ok.h>
#include <linux/cpufeature.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
#include <asm/mipsregs.h>
#include <asm/unaligned.h>

#include <crypto/internal/hash.h>

Expand Down
47 changes: 0 additions & 47 deletions arch/openrisc/include/asm/unaligned.h

This file was deleted.

6 changes: 1 addition & 5 deletions arch/parisc/include/asm/unaligned.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
#ifndef _ASM_PARISC_UNALIGNED_H
#define _ASM_PARISC_UNALIGNED_H

#include <linux/unaligned/be_struct.h>
#include <linux/unaligned/le_byteshift.h>
#include <linux/unaligned/generic.h>
#define get_unaligned __get_unaligned_be
#define put_unaligned __put_unaligned_be
#include <asm-generic/unaligned.h>

#ifdef __KERNEL__
struct pt_regs;
Expand Down
22 changes: 0 additions & 22 deletions arch/powerpc/include/asm/unaligned.h

This file was deleted.

Loading

0 comments on commit 4cad671

Please sign in to comment.