]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arm64: pass endianness info to sparse
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Sat, 24 Jun 2017 15:42:11 +0000 (17:42 +0200)
committerWill Deacon <will.deacon@arm.com>
Mon, 26 Jun 2017 09:15:06 +0000 (10:15 +0100)
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 <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: linux-arm-kernel@lists.infradead.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/Makefile

index fdb0133142ff534394a6da8d94a7a56426e3837d..9b41f1e3b1a039cd45fe842e10abff0181186fdf 100644 (file)
@@ -52,11 +52,13 @@ KBUILD_AFLAGS       += $(lseinstr) $(brokengasinst)
 
 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS        += -mbig-endian
+CHECKFLAGS     += -D__AARCH64EB__
 AS             += -EB
 LD             += -EB
 UTS_MACHINE    := aarch64_be
 else
 KBUILD_CPPFLAGS        += -mlittle-endian
+CHECKFLAGS     += -D__AARCH64EL__
 AS             += -EL
 LD             += -EL
 UTS_MACHINE    := aarch64