From patchwork Mon May 22 12:22:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13250461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13A23C7EE31 for ; Mon, 22 May 2023 12:25:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234018AbjEVMZs (ORCPT ); Mon, 22 May 2023 08:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234307AbjEVMZf (ORCPT ); Mon, 22 May 2023 08:25:35 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F3710DD for ; Mon, 22 May 2023 05:23:25 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f4b384c09fso729827e87.3 for ; Mon, 22 May 2023 05:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684758182; x=1687350182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QNGtYZHP+K0ibUJVp062Om/gTc5vNRdHlING4IaIZzs=; b=fLHAUMJE8wSslvQMdWoVmJPTUxLmmJXq6lrPAOjCD7b7WdJBGdTqFAaNBI9jAZ0JnN 1lML9Dvcdw8cfKAS5ZwZzear3U1/ExvV9Dq0uwg4AbG9X930/+8klNVewm2TS3f5RYM6 YJlL0KdOgaD4sdtPBX3atS4uhxD3S9K4PapPDDlBqEeyuYE1Pbk/4NyOGXMj8JBJcEVp Q5XSkl2M8oLm3mNJGPUwGGTPLdm4PSGp91X0g1U1EPP3OKwOWXOEOvpAoXQXjs0dZrJQ Jn8VjriZB29nI6Dm9mlh/o25bKdLJjDC3s6DeR0Papit83bnIIoJQMUuKxaNVWOhA0f9 Ct5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684758182; x=1687350182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QNGtYZHP+K0ibUJVp062Om/gTc5vNRdHlING4IaIZzs=; b=gkINNTPil/u/Mcq7/bxerSXyPe6XA6pzX7lP35RRbcQORApdVAcgEDmco0XTj6wrRf 2ezrDTGadHhNJmpiTcYw7FqIyP/0XiIMFyw2OpLXLrm6NU1T96sh0Oy9pjqARF39mR/z lgvh/u1x9rWabYK2qbRV8QLEj9zsoU3VsVtgWnNkhJthytvLkX2z5+wRjDC3HTg/WsGh OTksrf9UF5HstVgbafpfIiLiekkVzWk+uW+e+ScJocfHQDvaok06omrEDUeM+S+4K4/u gj4NyV8gwQiUqS97YkxKrhfZFm91MH4vXdXw+uHyqUDX9JJTGt0dzkSHc5i64GEAC+JS IK8w== X-Gm-Message-State: AC+VfDyF2wbbbO74Fog0iLxx2TEeRepgAftNQKBUsu9J/1FdmU7WxWzt wbpaM7vvSTDDz1IcbzXU5K3+vQ== X-Google-Smtp-Source: ACHHUZ75C39ShNDSb5J/HnD7gSQQwUoKvdbJfUs/lt1VYFYSSAAnerCgHJ23litPwTEt4Ouev7iEfw== X-Received: by 2002:a19:ad02:0:b0:4f1:866d:9b01 with SMTP id t2-20020a19ad02000000b004f1866d9b01mr3249814lfc.3.1684758182323; Mon, 22 May 2023 05:23:02 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id y9-20020ac24469000000b004efe8174586sm974633lfl.126.2023.05.22.05.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:23:01 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org Cc: Ilias Apalodimas , Arnd Bergmann , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Wolfgang Denk , Marek Vasut , Nobuhiro Iwamatsu , Marek Behun , Qu Wenruo , Tom Rini , Jens Wiklander Subject: [PATCH 1/8] arm: use asm-generic/unaligned.h Date: Mon, 22 May 2023 14:22:31 +0200 Message-Id: <20230522122238.4191762-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522122238.4191762-1-jens.wiklander@linaro.org> References: <20230522122238.4191762-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Arm duplicates the content of asm-generic/unaligned.h, so use that file directly instead. Signed-off-by: Jens Wiklander --- arch/arm/include/asm/unaligned.h | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/arch/arm/include/asm/unaligned.h b/arch/arm/include/asm/unaligned.h index 0a228fb8eea8..7fb482abc383 100644 --- a/arch/arm/include/asm/unaligned.h +++ b/arch/arm/include/asm/unaligned.h @@ -1,19 +1,2 @@ -#ifndef _ASM_ARM_UNALIGNED_H -#define _ASM_ARM_UNALIGNED_H - -#include -#include -#include - -/* - * Select endianness - */ -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define get_unaligned __get_unaligned_le -#define put_unaligned __put_unaligned_le -#else -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be -#endif - -#endif /* _ASM_ARM_UNALIGNED_H */ +/* SPDX-License-Identifier: GPL-2.0 */ +#include From patchwork Mon May 22 12:22:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13250463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A84CDC77B73 for ; Mon, 22 May 2023 12:25:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234038AbjEVMZu (ORCPT ); Mon, 22 May 2023 08:25:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234322AbjEVMZh (ORCPT ); Mon, 22 May 2023 08:25:37 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 318E810E6 for ; Mon, 22 May 2023 05:23:29 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f3baf04f0cso1925047e87.1 for ; Mon, 22 May 2023 05:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684758183; x=1687350183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1IyoCNdPUejBx0Nfm2fy7tQjrPviRbLySXuMppjkmh8=; b=gcgacHdAPcgEhgCGaZG7QK1H1+uKPTsNo0kUUb7TgKgRfAMt0O67jgYz3zwNpvaDJ8 YLD6IU4Jqe5CtpinZUEHkWpKEw0q02EEKdJzDfGDYHoaKWLYLlAZ32OJwoTB/NRq0nQF nWuvHq0XN0XF0mI4GZd6FToZXD1nSzWLtskMoMjRa51hgqzNDHudxRY2Ky4Z7Ft8D4SX AtV5+C5q2VDQmIIKvP/AeijYjiPNTAB28wg8M/UPxmCQuLDEO1XoI2U/0O7VzF8xd16g qW1kxzGRwVPfjmjxKMc6bQIDxzpV0CtsntTHX7IcBEf7lKqT5poODgBoCRB7uGiRkIHx DApw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684758183; x=1687350183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1IyoCNdPUejBx0Nfm2fy7tQjrPviRbLySXuMppjkmh8=; b=barnMncFD8m++0YzSndop4tRIYkQNYXF81se/odc36sYEhCJxuI3biiHpPaP2ThPGO WF52jP8uGdoOLmTVKUuVg9Tflgq0ocz8qz8kWYNiP55Ky6RPP41s0WZGl/qGbTtKps2C w9B42PoZW/BRy9lYRDb1irxMTzX4w+uJaw5lqZoGa6XGCSWz4ztag0VoYOHrIkbMxEe9 XuIAr4uspxDihKowJRRyfGFr8aYDoVqvs6WwSzFXvZfxWtMQ6sJVqO+CTARUXPdwddfz KUIJMWfTKgWZfhcOgaA585Eo4JANBbE5Pb6vKzaF6cDcbve7//ahbFyalQsegN0T7dkF v0lQ== X-Gm-Message-State: AC+VfDynewRl8eKpTA+7lJZ66SPlQ8nXjM91lT9/nphs9SVDkQ4TuP+L 9QMRbjCfsqsKvXvckv+FT6Hl0w== X-Google-Smtp-Source: ACHHUZ7GyrHaRLxZJn5CX+edppeQYtkDH6CWlWi/SgK14OWJ9VGKS0i2Zrq5Mv+0/A2rkwsEN2zsJg== X-Received: by 2002:ac2:5636:0:b0:4f3:89ca:246d with SMTP id b22-20020ac25636000000b004f389ca246dmr3437740lff.41.1684758183253; Mon, 22 May 2023 05:23:03 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id y9-20020ac24469000000b004efe8174586sm974633lfl.126.2023.05.22.05.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:23:02 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org Cc: Ilias Apalodimas , Arnd Bergmann , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Wolfgang Denk , Marek Vasut , Nobuhiro Iwamatsu , Marek Behun , Qu Wenruo , Tom Rini , Jens Wiklander Subject: [PATCH 2/8] sh: use asm-generic/unaligned.h Date: Mon, 22 May 2023 14:22:32 +0200 Message-Id: <20230522122238.4191762-3-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522122238.4191762-1-jens.wiklander@linaro.org> References: <20230522122238.4191762-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Sh essentially duplicates the content of asm-generic/unaligned.h, so use that file directly instead. Signed-off-by: Jens Wiklander --- arch/sh/include/asm/unaligned.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/arch/sh/include/asm/unaligned.h b/arch/sh/include/asm/unaligned.h index 5acf0819620e..7fb482abc383 100644 --- a/arch/sh/include/asm/unaligned.h +++ b/arch/sh/include/asm/unaligned.h @@ -1,20 +1,2 @@ -#ifndef _ASM_SH_UNALIGNED_H -#define _ASM_SH_UNALIGNED_H - -/* Copy from linux-kernel. */ - -/* Other than SH4A, SH can't handle unaligned accesses. */ -#include -#if defined(__BIG_ENDIAN__) -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be -#elif defined(__LITTLE_ENDIAN__) -#define get_unaligned __get_unaligned_le -#define put_unaligned __put_unaligned_le -#endif - -#include -#include -#include - -#endif /* _ASM_SH_UNALIGNED_H */ +/* SPDX-License-Identifier: GPL-2.0 */ +#include From patchwork Mon May 22 12:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13250464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D5AFC77B75 for ; Mon, 22 May 2023 12:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234045AbjEVMZv (ORCPT ); Mon, 22 May 2023 08:25:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234326AbjEVMZh (ORCPT ); Mon, 22 May 2023 08:25:37 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 976D310FF for ; Mon, 22 May 2023 05:23:29 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f00c33c3d6so7033614e87.2 for ; Mon, 22 May 2023 05:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684758184; x=1687350184; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VkynZCUSnXptnuFw0RrqFS1rki/zRgAPQZ+NR3djBSE=; b=j9n6oHiT28ypjm7yeymv/pn49MlFnBO0IanLlw3hx8RQYzwx+GiFOst0CPJQwOXQ6a fRUzqTQSlJU9S5qpVOzpXAGhjUkJRBZCJ6RJOL83J1eUiYwPxaDDYIQ5tWLo3xxbwjpl ctycr/Af7TUy0PUu3MixSBf2noa3il39n8pcw/EhHbBjcCBUjwNVjAIoHH0sQwTdKVwH xcVDiJteFeuHC/4hXpXNhnj9At51QrQOw4a/VCXs/NrewMWoxE60SIJXcZLdBYJtzWQA jdhN55g3rEQRqOWiK1EgrI+A2t/gSwPJIF3y5LFvcCOYFu6JvDhA/fFisTj/7TJe1R9T KpSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684758184; x=1687350184; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VkynZCUSnXptnuFw0RrqFS1rki/zRgAPQZ+NR3djBSE=; b=fEjpLpY5ndjtxmNiHolnqq4asxIx8nhVgq1Np1jlrG4JgxDdTVhnEmNSVFF04wNRwm lmaZClrqHnKWxrC4bcfAzl7c1Tyh35/PWUmDX1I6UeuDFlWWX2QTqhtIP7CAgmSZgK+2 XZF5hWBHXgGwXY9LBFe7hgbMxRRBCNXOrOmSy9w5OC/YK3o5KvfalhwP9EbkcdgkrnC/ mg0k2CdoBRAn+B/zFmZqtJjsCiSlH+HCQgZh2C3PWWzZuDcmEFFoZehQfhJit5QvoPP2 jaXI5dIRQbfUAuFO/V90JDVFvcX3RsdJa+pZbi1LT5jAWTWvHRFe3VDTBvPOlMGG+zLZ ko4w== X-Gm-Message-State: AC+VfDxQ8hN86R0HhSh8RUUqE2BW87nt1g6/GKZ0qbRc66IjhnmBbr1G 3XId+ozzDpqB1JoMsEDFlSMSyUPZnSHva0pNo10= X-Google-Smtp-Source: ACHHUZ4r/5hzp40R2860qVVD2TeL+9dpxzKr4cQukxP7E2K64BFDcW01/6GHmbhisYb7fP0IKcYaHg== X-Received: by 2002:ac2:4a85:0:b0:4f1:3eea:eaf9 with SMTP id l5-20020ac24a85000000b004f13eeaeaf9mr3519639lfp.24.1684758184110; Mon, 22 May 2023 05:23:04 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id y9-20020ac24469000000b004efe8174586sm974633lfl.126.2023.05.22.05.23.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:23:03 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org Cc: Ilias Apalodimas , Arnd Bergmann , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Wolfgang Denk , Marek Vasut , Nobuhiro Iwamatsu , Marek Behun , Qu Wenruo , Tom Rini , Jens Wiklander Subject: [PATCH 3/8] mips: use asm-generic/unaligned.h Date: Mon, 22 May 2023 14:22:33 +0200 Message-Id: <20230522122238.4191762-4-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522122238.4191762-1-jens.wiklander@linaro.org> References: <20230522122238.4191762-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Mips essentially duplicates the content of asm-generic/unaligned.h, so use that file directly instead. Signed-off-by: Jens Wiklander --- arch/mips/include/asm/unaligned.h | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/arch/mips/include/asm/unaligned.h b/arch/mips/include/asm/unaligned.h index debb9cf7aba6..7fb482abc383 100644 --- a/arch/mips/include/asm/unaligned.h +++ b/arch/mips/include/asm/unaligned.h @@ -1,23 +1,2 @@ /* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org) - */ -#ifndef _ASM_MIPS_UNALIGNED_H -#define _ASM_MIPS_UNALIGNED_H - -#include -#if defined(__MIPSEB__) -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be -#elif defined(__MIPSEL__) -#define get_unaligned __get_unaligned_le -#define put_unaligned __put_unaligned_le -#else -#error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" -#endif - -#include -#include -#include - -#endif /* _ASM_MIPS_UNALIGNED_H */ +#include From patchwork Mon May 22 12:22:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13250466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 892EAC7EE3A for ; Mon, 22 May 2023 12:25:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234055AbjEVMZx (ORCPT ); Mon, 22 May 2023 08:25:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234332AbjEVMZh (ORCPT ); Mon, 22 May 2023 08:25:37 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAAC11722 for ; Mon, 22 May 2023 05:23:30 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f3b9e54338so2194101e87.0 for ; Mon, 22 May 2023 05:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684758185; x=1687350185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GBQsGdAhjjQtrzp+A7D4JOJ/F5C9lrwx8Cr88FFeedo=; b=B5hfoPVCbs+fGyuD7c/Az/QZbDhOGBZajdppQjZGe1J9Ec5sNrp+TxfGFNQTGtDJE3 nGVnJ8uWgzHU4t8C0w74tJg+RfQMPFqKVXAq6tEEW0/4NqSbd4QXSMNzzsFcyCH3FIrs cRveOY0AhXCi1/+SZtqo6mRpdi2YMsG0RBZCwGmNw6VMJiwkgCMwJ4i1JrwIk9Hdma0I TdvkxxJgBftgEKsW9ZxFRCNRK4hPIy1oW/gGPOIt1GWH7pdETOU2R3rIRGJgCHfvg91f tNUwCCzgr1UdKoR33w9Et21ux0dKslj2eyb78/IOrz8l0pDUDBXE//sHv3S+Tmk8CGsx 3ZHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684758185; x=1687350185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GBQsGdAhjjQtrzp+A7D4JOJ/F5C9lrwx8Cr88FFeedo=; b=gF+SspeVr+WHxqOvU/ANOeuiaOgAZqh+b43OvMNPz5XEjxQMkurG17rNIWXriDFWty eJz2WfGO+vPge13hPln7RvR8RJJf/HIBm9AWA3+Ut/s8Mf448rfgc/g0+JRf37Ct8mZ2 BJkAw6UB5wnhki7k+Q3bI6ZjU0Q5Jj37mE8t6bm35VTIZhCyhm393QktxHj73RKxrdir hBeBcNUqaNYufTiRC3Tr+ZlQ9X0YbzIlB7rNxE7sw0uKbpbGaT6Zz/t2c3BEqYSOPOiX M4PoE6qLP3uW/tswrYexC06CMKm9Jb0IinHKQnr4u7feEgzgxrCkk3gxCeTw/7RUv+ZL yspg== X-Gm-Message-State: AC+VfDwDvkXZ9tfUrRfN1NeTr+AHo31Kg/+kW115vUFDS3MxiBU/q9Jf CACkpcJ8o/kXyafh5vVfYsbnCw== X-Google-Smtp-Source: ACHHUZ6h4606sIqJkCQPTzjkF4aKTV8L/fsdm2txu7CToQG4LG4MRzJSsHixS5eFgiBKFPbJ0el5Fg== X-Received: by 2002:ac2:5e87:0:b0:4f3:bbe1:34e2 with SMTP id b7-20020ac25e87000000b004f3bbe134e2mr1361959lfq.2.1684758184975; Mon, 22 May 2023 05:23:04 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id y9-20020ac24469000000b004efe8174586sm974633lfl.126.2023.05.22.05.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:23:04 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org Cc: Ilias Apalodimas , Arnd Bergmann , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Wolfgang Denk , Marek Vasut , Nobuhiro Iwamatsu , Marek Behun , Qu Wenruo , Tom Rini , Jens Wiklander Subject: [PATCH 4/8] m68k: use asm-generic/unaligned.h Date: Mon, 22 May 2023 14:22:34 +0200 Message-Id: <20230522122238.4191762-5-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522122238.4191762-1-jens.wiklander@linaro.org> References: <20230522122238.4191762-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org M68k essentially duplicates the content of asm-generic/unaligned.h, with an exception for non-Coldfire configurations. Coldfire configurations are apparently able to do unaligned accesses. But in an attempt to clean up and handle unaligned accesses in the same way we ignore that and use the common asm-generic/unaligned.h directly instead. Signed-off-by: Jens Wiklander Acked-by: Angelo Dureghello --- arch/m68k/include/asm/unaligned.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/arch/m68k/include/asm/unaligned.h b/arch/m68k/include/asm/unaligned.h index 328aa0c316c9..7fb482abc383 100644 --- a/arch/m68k/include/asm/unaligned.h +++ b/arch/m68k/include/asm/unaligned.h @@ -1,15 +1,2 @@ -#ifndef _ASM_M68K_UNALIGNED_H -#define _ASM_M68K_UNALIGNED_H - -#ifdef CONFIG_COLDFIRE -#include -#else -#include -#endif - -#include - -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be - -#endif /* _ASM_M68K_UNALIGNED_H */ +/* SPDX-License-Identifier: GPL-2.0 */ +#include From patchwork Mon May 22 12:22:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13250465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C6B1C7EE33 for ; Mon, 22 May 2023 12:25:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233239AbjEVMZw (ORCPT ); Mon, 22 May 2023 08:25:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234336AbjEVMZi (ORCPT ); Mon, 22 May 2023 08:25:38 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46964173C for ; Mon, 22 May 2023 05:23:31 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f380cd1019so6857017e87.1 for ; Mon, 22 May 2023 05:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684758186; x=1687350186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a3st1/PAYQMvCElncbKXPE+lFmIJcFQFBwuXv80unt4=; b=n0zC7oRvoC8++nW2PXO3OgOjJ3Xmoo4wtrIL1cmxjBuVIK+Q0z4KWjCW1aAqDzT7cF aIuNCHSd2ZoYkShHE9W3r9r7+GSeyUsN+97jWEVz4CB1APTRYin3Pw3/LkNT/1OfMRAC 52SkNugdtN3RTRFPQn3LIZxrO3PCQg9B3kXgzbfqj7WuHLa/Un38cYUtiGH7xNsiVEkY AkJhcW7v95Gui7FWD7e3iHbSpZBBtIwcsH3o4gIknEcXkBgLj9hfZFCJwBpKemX716kI KNLZGT/NFreXM2+ynakCAEKDsCh2tzQGjnd+siss4KFXP8wCSBa6bMDGG2K96k+kMSAO V6Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684758186; x=1687350186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a3st1/PAYQMvCElncbKXPE+lFmIJcFQFBwuXv80unt4=; b=Up+iu9XOKq9jDiBMl7uUTNuSFnevqnTTrelk9lh7mSyq6qAyyRkHTebH8mTKkkuCAE GK9nKdbRSdo97VmbJZd0fyMNvnwckTA9rzJGFcRy3XtHRO4uaS+QBX1CCOaTgDrfiTfr /hWoq9uYBUMDGqoWVlYBqO/g0OQed0C22EgAUe5kwoLtk0OvI+P0kHaM7mmSKQ4HFlgv PKcjoDR1ZtjrZU6FfKNnq2lLnDf4iYWneTeoRQAxhr/9XhHY5EXJ2OinLWFolFc9r8LX /se4Y4IaczAr95zMIstB1zVuZ6+593ZlpDA9xFl1lg9wWnfm9Z+IfGfPJ09KLmT9mTSc NJtw== X-Gm-Message-State: AC+VfDw+eoOAJa4JIZ+zSRdxA7KNSpWmQ/cqcATXSgbzA55cJB7+4vow 2c4uQEBXTL46KTX/4KBXpfyQBtV/Kk1Uen6Q1kI= X-Google-Smtp-Source: ACHHUZ6jbKvVV/iDts8KAcrrVsUl1aheesF2zeGMr0Wd48C3BfCC23VeXLLRSoBAWet5tPpeiGCP5A== X-Received: by 2002:ac2:52aa:0:b0:4ef:d6e2:6530 with SMTP id r10-20020ac252aa000000b004efd6e26530mr3034459lfm.37.1684758185844; Mon, 22 May 2023 05:23:05 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id y9-20020ac24469000000b004efe8174586sm974633lfl.126.2023.05.22.05.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:23:05 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org Cc: Ilias Apalodimas , Arnd Bergmann , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Wolfgang Denk , Marek Vasut , Nobuhiro Iwamatsu , Marek Behun , Qu Wenruo , Tom Rini , Jens Wiklander Subject: [PATCH 5/8] powerpc: use asm-generic/unaligned.h Date: Mon, 22 May 2023 14:22:35 +0200 Message-Id: <20230522122238.4191762-6-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522122238.4191762-1-jens.wiklander@linaro.org> References: <20230522122238.4191762-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Powerpc configurations are apparently able to do unaligned accesses. But in an attempt to clean up and handle unaligned accesses in the same way we ignore that and use the common asm-generic/unaligned.h directly instead. Signed-off-by: Jens Wiklander --- arch/powerpc/include/asm/unaligned.h | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/include/asm/unaligned.h b/arch/powerpc/include/asm/unaligned.h index 5f1b1e3c2137..7fb482abc383 100644 --- a/arch/powerpc/include/asm/unaligned.h +++ b/arch/powerpc/include/asm/unaligned.h @@ -1,16 +1,2 @@ -#ifndef _ASM_POWERPC_UNALIGNED_H -#define _ASM_POWERPC_UNALIGNED_H - -#ifdef __KERNEL__ - -/* - * The PowerPC can do unaligned accesses itself in big endian mode. - */ -#include -#include - -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be - -#endif /* __KERNEL__ */ -#endif /* _ASM_POWERPC_UNALIGNED_H */ +/* SPDX-License-Identifier: GPL-2.0 */ +#include From patchwork Mon May 22 12:22:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13250467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E672C77B75 for ; Mon, 22 May 2023 12:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234060AbjEVMZy (ORCPT ); Mon, 22 May 2023 08:25:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234340AbjEVMZi (ORCPT ); Mon, 22 May 2023 08:25:38 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9052E75 for ; Mon, 22 May 2023 05:23:31 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f3b337e842so3032477e87.3 for ; Mon, 22 May 2023 05:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684758186; x=1687350186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fTm7XVsRWqH2HCRI9krBqQuQdUq136YutGjJEaeI4i4=; b=oo2r05pILUiyxbRcxUbCt9aBSDf1oiLbuhSnqbi8bta6GtmQvsQNB2m36/aadk7QH5 CEWm9hsCMLUwzQphqoMNVjDWW4uIwO5G6vCQjjBppoYB9wn4I7JBgKNh6sMDF5l3MnFJ jN4xCWZfYg77rjiOQSIfqNhgUIJ/WmbcHHAvnhXhKcjk6cHd5n3b4sccpLnVhOqXDWMl Gh00o3Au4aD1j6zeOUl39AcZsKV5+qX/UcWFB82CAYqvgXXoHkNkOFbhOPyiKzV/p+P8 ldEDPO5qaGFB3Mmu+Nsr9x0F67r29Yyvmkz9hXZPqzuCi4M/CN6tE5uJPMvaxVNbYlzz kX+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684758186; x=1687350186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fTm7XVsRWqH2HCRI9krBqQuQdUq136YutGjJEaeI4i4=; b=lb78lQ/ee7rmnht1DVcTfPezj8vKmMhwhuHWZEqzdtCeWXuYW3m1XZoUimHKU/vPy7 473pI2KZPuUBAcs14ZD3rWtv5Wcb6VpyvnJACInt4ug/z1yk6sK0eiG/gUbT4VDwdRLb 4sL07UpZjOxOJsn1x6PfolNUcrGhXdioGIiTZTltpykxHDERgN4bCeI9dGzEotv52dG6 6eaDMf01BeQzN+7QbVOU+H/cmGBwI5nD2yEkTdf+I4aQxHj+W52hbhBW3/ecVFvtk6em eLayujRGxF9pHtj939dCI4To6vQuvzSwPXHf3quSMF4cBOrTckufZoTSYEfweSwOtXnp +tSw== X-Gm-Message-State: AC+VfDyQysWNhKzxxal59OoIcl0ZlcI0udAJQh/90e81lXpV/REnhnkn kr5nhqAJ4fyFR4jC9pJ2paCnLQ== X-Google-Smtp-Source: ACHHUZ4dVNPnsFfz2BAESY6r6aoue5MyxLHfnCqJPzPkGF4N1x/4qmQEIekavTbLLlLcNFSk6ACLlw== X-Received: by 2002:ac2:5991:0:b0:4f3:aa1e:8fd with SMTP id w17-20020ac25991000000b004f3aa1e08fdmr3342122lfn.68.1684758186734; Mon, 22 May 2023 05:23:06 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id y9-20020ac24469000000b004efe8174586sm974633lfl.126.2023.05.22.05.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:23:06 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org Cc: Ilias Apalodimas , Arnd Bergmann , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Wolfgang Denk , Marek Vasut , Nobuhiro Iwamatsu , Marek Behun , Qu Wenruo , Tom Rini , Jens Wiklander Subject: [PATCH 6/8] fs/btrfs: use asm/unaligned.h Date: Mon, 22 May 2023 14:22:36 +0200 Message-Id: <20230522122238.4191762-7-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522122238.4191762-1-jens.wiklander@linaro.org> References: <20230522122238.4191762-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Use asm/unaligned.h instead of linux/unaligned/access_ok.h for unaligned access. This is needed on architectures that doesn't handle unaligned accesses directly. Signed-off-by: Jens Wiklander --- fs/btrfs/crypto/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/crypto/hash.c b/fs/btrfs/crypto/hash.c index 891a2974be05..0a0b35fe9b96 100644 --- a/fs/btrfs/crypto/hash.c +++ b/fs/btrfs/crypto/hash.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ +#include #include -#include #include #include #include From patchwork Mon May 22 12:22:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13250468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76FFBC7EE2A for ; Mon, 22 May 2023 12:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233621AbjEVM0B (ORCPT ); Mon, 22 May 2023 08:26:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234346AbjEVMZj (ORCPT ); Mon, 22 May 2023 08:25:39 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6ABC171D for ; Mon, 22 May 2023 05:23:32 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f4b256a0c9so883911e87.2 for ; Mon, 22 May 2023 05:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684758187; x=1687350187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/5kWyxReGc6+NbR/divUaYbGoYpsEUJapS8Ahu/mXns=; b=eDgGrNvX7xOGsi5V8joS0Ax4Tu8K6WkqrHWKIHxlYSGufqnGTRR1mp3qEqS8UZ10+Y criMHN1Kp+8D7G/EWKfIi3mpVr/HRZykPSmxLawPWBSat0P+VxCKzl50nsQI8gaSJj++ FklfaiuXTgTxEb2ol3xeJcfjriptj5u9jZNTTUxFmAhTTuPAVyg/VPqz4Ob243BKynAG GS/UXYSefSbzLT0S1lFd5eZ0U0w84chyC08H8R9s9RakjPCf6ckeWYJclvyUH/OgcV4y eUE3hI66fzOcq2eeEjqA1uMJo58WGo0umXLCYrg5MnNQWH1YAHI5ioEiuC3F3ygeKtYr gJCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684758187; x=1687350187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/5kWyxReGc6+NbR/divUaYbGoYpsEUJapS8Ahu/mXns=; b=Eh/DSN0N12OcH1D+o3iy93h4VNzgCJK5yYSpyJmnrx1VRPsp/L8cKYhWCVserrzq17 AJOqtKXJ/ctK9CAALm4slupxitubLYfoYrn+H/DWxSIZcaNGOMphcLJ7jurCn9S9ab/G 7XGamfiIPM5VqE57+QIkQWA6wEBQSEqfl9JWTKJBFBmDI7Za4Xdx0zgavmt8r4ipt8W7 881ckbj2dqGDqpFWGi2t68Xh+4dXvI6lQiZVwCAqvwS68tLqKrx3p9VvjzH7T61a3ZtW cie7r/SBhhbEOyz9T3MGmNjbL22SAkC4KMFBugpmNw/XBgPBVApJwosbOqZqpmOgA4hJ 79Pg== X-Gm-Message-State: AC+VfDywQTMaeffJAtxTHJgvIjDWsEagjO+HBeJlmRAlBQHhwqb3Q0HT YdAWFnQB4lpXAyWRXHpsrx3Gag== X-Google-Smtp-Source: ACHHUZ6U8fx1A1LU2xz/aiiAniQ6LFqBJfwqQyMXfEOLYWNp+S2ZJjRRQdIl0Zwl1rOCy4TGkTLVBA== X-Received: by 2002:ac2:5991:0:b0:4f3:aa1e:8fd with SMTP id w17-20020ac25991000000b004f3aa1e08fdmr3342132lfn.68.1684758187582; Mon, 22 May 2023 05:23:07 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id y9-20020ac24469000000b004efe8174586sm974633lfl.126.2023.05.22.05.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:23:07 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org Cc: Ilias Apalodimas , Arnd Bergmann , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Wolfgang Denk , Marek Vasut , Nobuhiro Iwamatsu , Marek Behun , Qu Wenruo , Tom Rini , Jens Wiklander Subject: [PATCH 7/8] linux/unaligned: remove unused access_ok.h Date: Mon, 22 May 2023 14:22:37 +0200 Message-Id: <20230522122238.4191762-8-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522122238.4191762-1-jens.wiklander@linaro.org> References: <20230522122238.4191762-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org linux/unaligned/access_ok.h is unused, so remove it. Signed-off-by: Jens Wiklander --- include/linux/unaligned/access_ok.h | 66 ----------------------------- 1 file changed, 66 deletions(-) delete mode 100644 include/linux/unaligned/access_ok.h diff --git a/include/linux/unaligned/access_ok.h b/include/linux/unaligned/access_ok.h deleted file mode 100644 index 5f46eee23c38..000000000000 --- a/include/linux/unaligned/access_ok.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef _LINUX_UNALIGNED_ACCESS_OK_H -#define _LINUX_UNALIGNED_ACCESS_OK_H - -#include - -static inline u16 get_unaligned_le16(const void *p) -{ - return le16_to_cpup((__le16 *)p); -} - -static inline u32 get_unaligned_le32(const void *p) -{ - return le32_to_cpup((__le32 *)p); -} - -static inline u64 get_unaligned_le64(const void *p) -{ - return le64_to_cpup((__le64 *)p); -} - -static inline u16 get_unaligned_be16(const void *p) -{ - return be16_to_cpup((__be16 *)p); -} - -static inline u32 get_unaligned_be32(const void *p) -{ - return be32_to_cpup((__be32 *)p); -} - -static inline u64 get_unaligned_be64(const void *p) -{ - return be64_to_cpup((__be64 *)p); -} - -static inline void put_unaligned_le16(u16 val, void *p) -{ - *((__le16 *)p) = cpu_to_le16(val); -} - -static inline void put_unaligned_le32(u32 val, void *p) -{ - *((__le32 *)p) = cpu_to_le32(val); -} - -static inline void put_unaligned_le64(u64 val, void *p) -{ - *((__le64 *)p) = cpu_to_le64(val); -} - -static inline void put_unaligned_be16(u16 val, void *p) -{ - *((__be16 *)p) = cpu_to_be16(val); -} - -static inline void put_unaligned_be32(u32 val, void *p) -{ - *((__be32 *)p) = cpu_to_be32(val); -} - -static inline void put_unaligned_be64(u64 val, void *p) -{ - *((__be64 *)p) = cpu_to_be64(val); -} - -#endif /* _LINUX_UNALIGNED_ACCESS_OK_H */ From patchwork Mon May 22 12:22:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13250469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 784A6C77B73 for ; Mon, 22 May 2023 12:26:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232810AbjEVM0I (ORCPT ); Mon, 22 May 2023 08:26:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234351AbjEVMZj (ORCPT ); Mon, 22 May 2023 08:25:39 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4744C198A for ; Mon, 22 May 2023 05:23:33 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f122ff663eso6536707e87.2 for ; Mon, 22 May 2023 05:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684758188; x=1687350188; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M2CVbqNckF43m3ty4BotwDE58WAGFSlKLdkpEY7V8JY=; b=XBsnnBEBxOg0EE/geZVsCvMl8WOUCesvlS7tMnpzZWExxFnoe+ZW6WN2RCeQmxVvkz 9LWlh69ynmKgBH8EE7OJLPoVw4pVYzShp8Elf+012cyVZ6IQEW/VL2K2z0xP5KtBF2cJ dPO+dXKS9Zf/+aZ1vp1hyDZXAH/I3KSMCVESK47xN7SeMbyyS1LP/VCG2Zl1quqjirGO qzO6hVBzfaZHqLhLnLV138pTkh2ihcY8vQpDUekKFk5Po8RTJbFn+n2juSKTR8cpIOCr aOs6klcR+1eICyqloJTe2/3qglmfssFe2ZXo0vDpDaj9d+V375XdtgCV4F8DVplroVfb YjMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684758188; x=1687350188; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M2CVbqNckF43m3ty4BotwDE58WAGFSlKLdkpEY7V8JY=; b=UXA/xe+BMqW1zSC7fO+iB+HZchQnbYRmQw1MWZTNEpYD/d5Fz4OHXsoHjKkJ41E63C DdwZxCNfn4P9WVQvHuQsHkU+OQuxljPxX7MMx+/9rVFn2+KtxT8dGFLTRdLCUONJk+WM TMIDHCrVbYqTd3/uIuhhcmCROlMK5W/WTc00wAgb2btUqlJ1AftP98RjJAw1o/++fRvF XD+AUCk9RjPTW9Pfe3eITyU2Rmy5TEIeXBDpGkeVM+5m4uXalZ/wltHf/OuXX4rm/9l/ vedivoUr/Wf6ZQS14ByqSnq2lCtgLtqOzlf4S0EyjIqYWWaohBAW7sCATcgJXDYzPpb8 tYKA== X-Gm-Message-State: AC+VfDxbcVpTsubZmFLzlfXKXoDgv6M0455xkQBkT4J97Q7cF+pUwhwP Hg+tvFOG45shs6/JqjmD62xZQg== X-Google-Smtp-Source: ACHHUZ6vXBs+yoSqZqT3/15SvcvJIboKiRqZ7ovmbUF14Bbh1pV+ByRcEL2+X7pAVnLKAEYCWI0SCg== X-Received: by 2002:ac2:44d4:0:b0:4f4:7a2:643b with SMTP id d20-20020ac244d4000000b004f407a2643bmr1062913lfm.14.1684758188390; Mon, 22 May 2023 05:23:08 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id y9-20020ac24469000000b004efe8174586sm974633lfl.126.2023.05.22.05.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:23:08 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de, linux-btrfs@vger.kernel.org Cc: Ilias Apalodimas , Arnd Bergmann , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Wolfgang Denk , Marek Vasut , Nobuhiro Iwamatsu , Marek Behun , Qu Wenruo , Tom Rini , Jens Wiklander Subject: [PATCH 8/8] asm-generic: simplify unaligned.h Date: Mon, 22 May 2023 14:22:38 +0200 Message-Id: <20230522122238.4191762-9-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230522122238.4191762-1-jens.wiklander@linaro.org> References: <20230522122238.4191762-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The get_unaligned()/put_unaligned() implementations are more complex than necessary. Move everything into one file and use a more compact implementation based on packed struct access and byte swapping macros. This patch is based on the Linux kernel commit 803f4e1eab7a ("asm-generic: simplify asm/unaligned.h") by Arnd Bergmann. Signed-off-by: Jens Wiklander --- include/asm-generic/unaligned.h | 89 +++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 16 deletions(-) diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index 3d33a5a063e8..9e5d93ec3041 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h @@ -1,24 +1,81 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _GENERIC_UNALIGNED_H #define _GENERIC_UNALIGNED_H #include -#include -#include -#include - -/* - * Select endianness - */ -#if defined(__LITTLE_ENDIAN) -#define get_unaligned __get_unaligned_le -#define put_unaligned __put_unaligned_le -#elif defined(__BIG_ENDIAN) -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be -#else -#error invalid endian -#endif +#define __get_unaligned_t(type, ptr) ({ \ + const struct { type x; } __packed * __pptr = (typeof(__pptr))(ptr); \ + __pptr->x; \ +}) + +#define __put_unaligned_t(type, val, ptr) do { \ + struct { type x; } __packed * __pptr = (typeof(__pptr))(ptr); \ + __pptr->x = (val); \ +} while (0) + +#define get_unaligned(ptr) __get_unaligned_t(typeof(*(ptr)), (ptr)) +#define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr)) + +static inline u16 get_unaligned_le16(const void *p) +{ + return le16_to_cpu(__get_unaligned_t(__le16, p)); +} + +static inline u32 get_unaligned_le32(const void *p) +{ + return le32_to_cpu(__get_unaligned_t(__le32, p)); +} + +static inline u64 get_unaligned_le64(const void *p) +{ + return le64_to_cpu(__get_unaligned_t(__le64, p)); +} + +static inline void put_unaligned_le16(u16 val, void *p) +{ + __put_unaligned_t(__le16, cpu_to_le16(val), p); +} + +static inline void put_unaligned_le32(u32 val, void *p) +{ + __put_unaligned_t(__le32, cpu_to_le32(val), p); +} + +static inline void put_unaligned_le64(u64 val, void *p) +{ + __put_unaligned_t(__le64, cpu_to_le64(val), p); +} + +static inline u16 get_unaligned_be16(const void *p) +{ + return be16_to_cpu(__get_unaligned_t(__be16, p)); +} + +static inline u32 get_unaligned_be32(const void *p) +{ + return be32_to_cpu(__get_unaligned_t(__be32, p)); +} + +static inline u64 get_unaligned_be64(const void *p) +{ + return be64_to_cpu(__get_unaligned_t(__be64, p)); +} + +static inline void put_unaligned_be16(u16 val, void *p) +{ + __put_unaligned_t(__be16, cpu_to_be16(val), p); +} + +static inline void put_unaligned_be32(u32 val, void *p) +{ + __put_unaligned_t(__be32, cpu_to_be32(val), p); +} + +static inline void put_unaligned_be64(u64 val, void *p) +{ + __put_unaligned_t(__be64, cpu_to_be64(val), p); +} /* Allow unaligned memory access */ void allow_unaligned(void);