Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1561820pxv; Fri, 2 Jul 2021 06:50:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbjJedzs+n9G3dJOoFBEdGr1aKevL/DWJrrv5TU3ha4/swuMRJ7B12tjntxDL9Ouga3cWe X-Received: by 2002:a05:6638:279:: with SMTP id x25mr4430673jaq.33.1625233858168; Fri, 02 Jul 2021 06:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625233858; cv=none; d=google.com; s=arc-20160816; b=mJ0VxAz05UKo5qSN5IUnm2XEl1ISl1ytrJRFI1JrWcs8t5ke8P7RsA2hh79VtgznwC AUysO5nnfSVOm4Kyy5+VcKWgX2y9EWKAh9TTZo5LXglvlkE4pbwffhzyso1PMLmYSUXL i8Wa8Uau5J/3eOnV5s2IsOsk0qtGl8D98e5lZzMxVjlL3fBJoqS7TBhyTZ1Q+L2PN4/N ENHYDsWXpJvAH1BVPa3BI9L/AFjyyoD2VXRIT5qnHFwqagyNYonnYF1sP0qhW9CPxMnj 9+AkLgKx3Q+XT6EhOWEWXd2gPvbLadaRoe+ZTMGTl/A5tcRU/QkmilNwA9CSbepa6HSb Mr5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Jte9TqSdMucHKNAjFRsi6QooKsRkOCLLPvuXvQnlilc=; b=uksI5yK0bq2EXqExbdgs2hBxVpatIZZBtjmNlyKqEFOLDdcxdA39p/Da61WvuR4ydA /IzJk2TrpwI0fX0dUulAu5YKRkwqfi5k++QF6FZPRaskwI717eItt+NXFB3Qz4fUwXtP fezuoj7Hs3pexfouQtNbIV0Unv948xH4W1Ohm8QmoDBtxwpGPDEHXPqZG5CkTxL1j2td bBifhwyQB6MuNClnqF4XVmnYAPTWpxcobxWvdsfm9nVO9cSvzmnmjDkoHzTBRnP5xQvS lH2jBt5R1mXeSh33LIul6NuV/8Hrxp6W9hf1abpq7UAK3V4fKJ9pDFzyU3g0bqmhg8ti WCXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WMbipGNU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si3681362ilm.45.2021.07.02.06.50.44; Fri, 02 Jul 2021 06:50:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WMbipGNU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232785AbhGBNwT (ORCPT + 99 others); Fri, 2 Jul 2021 09:52:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:50394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232691AbhGBNwT (ORCPT ); Fri, 2 Jul 2021 09:52:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 84510613F4; Fri, 2 Jul 2021 13:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625233787; bh=OHdeFEnQVJvOVh/or6l4rellXMMPBuzIf6W0CCnQbo0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WMbipGNUPIt7k7ijQ8kPktcEBkAm9860rR5GmqYWJcLldRqIQKg6MeAz32vPVb5Bi FbrlpYE+Sk97ckwvyp2bMJWepu8Vtn6cDaptnGQEcyM3933SW4mJw7ctKOamicJ+cX mPLEk5MsMErkTlVM7sb7tZ7HCa7OJUUbaX9fmYslx/Wx8Xe1XPTtNe4x0F2TheptvZ oeMwNcyT8Ol82CWxRFlvc3JCby7eBt5e9s8SMjLEDwhe235efWrUecCbbFLb76SLi1 bk5Qwo7G7niLett1eKVSOPHeCVde7NXc04pO9u9UcsmgjZLtJmvJSIIuOcsGLrUksE jFtnDUJ2BVp0A== Received: by mail-wr1-f46.google.com with SMTP id a8so879595wrp.5; Fri, 02 Jul 2021 06:49:47 -0700 (PDT) X-Gm-Message-State: AOAM531N+m6EYJCRZRdDMnaXph6YiDlWgnysrcor6OalEMTqcBCOvhFt Xoq6406nLmXVch9kWiNMQl5M+CT0xeAaAOz/5fk= X-Received: by 2002:adf:ee10:: with SMTP id y16mr6064774wrn.99.1625233786121; Fri, 02 Jul 2021 06:49:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Arnd Bergmann Date: Fri, 2 Jul 2021 15:49:30 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: [GIT PULL 2/2] asm-generic: Unify asm/unaligned.h around struct helper To: Linus Torvalds Cc: linux-arch , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following changes since commit 6efb943b8616ec53a5e444193dccf1af9ad627b5: Linux 5.13-rc1 (2021-05-09 14:17:44 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git tags/asm-generic-unaligned-5.14 for you to fetch changes up to 803f4e1eab7a8938ba3a3c30dd4eb5e9eeef5e63: asm-generic: simplify asm/unaligned.h (2021-05-17 13:30:29 +0200) ---------------------------------------------------------------- asm-generic/unaligned: 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/75d07691-1e4f-741f-9852-38c0b4f520bc@synopsys.com/ Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100363 Link: https://lore.kernel.org/lkml/20210507220813.365382-14-arnd@kernel.org/ 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/ Signed-off-by: Arnd Bergmann ---------------------------------------------------------------- Arnd Bergmann (13): asm-generic: use asm-generic/unaligned.h for most architectures openrisc: always use unaligned-struct header sh: remove unaligned access for sh4a m68k: select CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS powerpc: use linux/unaligned/le_struct.h on LE power7 asm-generic: unaligned: remove byteshift helpers asm-generic: unaligned always use struct helpers partitions: msdos: fix one-byte get_unaligned() apparmor: use get_unaligned() only for multi-byte words mwifiex: re-fix for unaligned accesses netpoll: avoid put_unaligned() on single character asm-generic: uaccess: 1-byte access is always aligned asm-generic: simplify asm/unaligned.h arch/alpha/include/asm/unaligned.h | 12 -- arch/arm/include/asm/unaligned.h | 27 ---- arch/ia64/include/asm/unaligned.h | 12 -- arch/m68k/Kconfig | 1 + arch/m68k/include/asm/unaligned.h | 26 ---- arch/microblaze/include/asm/unaligned.h | 27 ---- arch/mips/crypto/crc32-mips.c | 2 +- arch/openrisc/include/asm/unaligned.h | 47 ------- arch/parisc/include/asm/unaligned.h | 6 +- arch/powerpc/include/asm/unaligned.h | 22 --- arch/sh/include/asm/unaligned-sh4a.h | 199 ---------------------------- arch/sh/include/asm/unaligned.h | 13 -- arch/sparc/include/asm/unaligned.h | 11 -- arch/x86/include/asm/unaligned.h | 15 --- arch/xtensa/include/asm/unaligned.h | 29 ---- block/partitions/ldm.c | 2 +- block/partitions/ldm.h | 3 - block/partitions/msdos.c | 24 ++-- drivers/net/wireless/marvell/mwifiex/pcie.c | 10 +- include/asm-generic/uaccess.h | 4 +- include/asm-generic/unaligned.h | 141 ++++++++++++++++---- include/linux/unaligned/access_ok.h | 68 ---------- include/linux/unaligned/be_byteshift.h | 71 ---------- include/linux/unaligned/be_memmove.h | 37 ------ include/linux/unaligned/be_struct.h | 37 ------ include/linux/unaligned/generic.h | 115 ---------------- include/linux/unaligned/le_byteshift.h | 71 ---------- include/linux/unaligned/le_memmove.h | 37 ------ include/linux/unaligned/le_struct.h | 37 ------ include/linux/unaligned/memmove.h | 46 ------- net/core/netpoll.c | 4 +- security/apparmor/policy_unpack.c | 2 +- 32 files changed, 141 insertions(+), 1017 deletions(-) delete mode 100644 arch/alpha/include/asm/unaligned.h delete mode 100644 arch/arm/include/asm/unaligned.h delete mode 100644 arch/ia64/include/asm/unaligned.h delete mode 100644 arch/m68k/include/asm/unaligned.h delete mode 100644 arch/microblaze/include/asm/unaligned.h delete mode 100644 arch/openrisc/include/asm/unaligned.h delete mode 100644 arch/powerpc/include/asm/unaligned.h delete mode 100644 arch/sh/include/asm/unaligned-sh4a.h delete mode 100644 arch/sh/include/asm/unaligned.h delete mode 100644 arch/sparc/include/asm/unaligned.h delete mode 100644 arch/x86/include/asm/unaligned.h delete mode 100644 arch/xtensa/include/asm/unaligned.h delete mode 100644 include/linux/unaligned/access_ok.h delete mode 100644 include/linux/unaligned/be_byteshift.h delete mode 100644 include/linux/unaligned/be_memmove.h delete mode 100644 include/linux/unaligned/be_struct.h delete mode 100644 include/linux/unaligned/generic.h delete mode 100644 include/linux/unaligned/le_byteshift.h delete mode 100644 include/linux/unaligned/le_memmove.h delete mode 100644 include/linux/unaligned/le_struct.h delete mode 100644 include/linux/unaligned/memmove.h