]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ARM: 8716/1: pass endianness info to sparse
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Tue, 31 Oct 2017 17:19:15 +0000 (18:19 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Wed, 1 Nov 2017 19:14:49 +0000 (19:14 +0000)
ARM depends on the macros '__ARMEL__' & '__ARMEB__' being defined
or not to correctly select or define endian-specific macros,
structures or pieces of code.

These macros are predefined by the compiler but sparse knows
nothing about them and thus may pre-process files differently
from what gcc would.

Fix this by passing '-D__ARMEL__' or '-D__ARMEB__' to sparse,
depending on the endianness of the kernel, like defined by GCC.

Note: In most case it won't change anything since most ARMs use
      little-endian (but an allyesconfig would use big-endian!).

To: Russell King <linux@armlinux.org.uk>

Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/Makefile

index 817e5cfef83a933e8d66bfd62a7c908a1af92f2c..36ae4454554ce1a11cc65848c60569bf8b3e0abe 100644 (file)
@@ -44,10 +44,12 @@ endif
 
 ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
 KBUILD_CPPFLAGS        += -mbig-endian
+CHECKFLAGS     += -D__ARMEB__
 AS             += -EB
 LD             += -EB
 else
 KBUILD_CPPFLAGS        += -mlittle-endian
+CHECKFLAGS     += -D__ARMEL__
 AS             += -EL
 LD             += -EL
 endif