From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam02on0113.outbound.protection.outlook.com ([104.47.36.113]:53303 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932708AbeDIAg7 (ORCPT ); Sun, 8 Apr 2018 20:36:59 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Luc Van Oostenryck , Catalin Marinas , Will Deacon , "linux-arm-kernel@lists.infradead.org" , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 072/162] arm64: pass endianness info to sparse Date: Mon, 9 Apr 2018 00:28:35 +0000 Message-ID: <20180409002738.163941-72-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Luc Van Oostenryck [ Upstream commit bcde519e8c325f3cc1fcf443eb6466e6bb3a3aca ] ARM64 depends on the macro __AARCH64EB__ being defined or not to correctly select or define endian-specific macros, structures or pieces of code. This macro is predefined by the compiler but sparse knows nothing about it and thus may pre-process files differently from what gcc would. Fix this by passing '-D__AARCH64EL__' or '-D__AARCH64EB__' to sparse depending of the endianness of the kernel, like defined by GCC. Note: In most case it won't change anything since most arm64 use little-endian (but an allyesconfig would use big-endian!). CC: Catalin Marinas CC: Will Deacon CC: linux-arm-kernel@lists.infradead.org Signed-off-by: Luc Van Oostenryck Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 119d1885a3c0..95c667328b5d 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -32,10 +32,12 @@ KBUILD_AFLAGS +=3D $(lseinstr) =20 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) KBUILD_CPPFLAGS +=3D -mbig-endian +CHECKFLAGS +=3D -D__AARCH64EB__ AS +=3D -EB LD +=3D -EB else KBUILD_CPPFLAGS +=3D -mlittle-endian +CHECKFLAGS +=3D -D__AARCH64EL__ AS +=3D -EL LD +=3D -EL endif --=20 2.15.1