c6x: pass endianness info to sparse
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Tue, 31 Oct 2017 17:22:02 +0000 (18:22 +0100)
committerMark Salter <msalter@redhat.com>
Tue, 10 Apr 2018 13:58:58 +0000 (09:58 -0400)
c6x depends on the macro '_BIG_ENDIAN' 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_BIG_ENDIAN' when compiling a big-endian
kernel, like GCC would have done.

To: Mark Salter <msalter@redhat.com>
To: Aurelien Jacquiot <a-jacquiot@ti.com>
CC: linux-c6x-dev@linux-c6x.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Mark Salter <msalter@redhat.com>
arch/c6x/Makefile

index 6f6096ff05a462182797cc75587f70c7d6286a53..6ab942e6c534a01be558b1a1e85511b4f6dacbe9 100644 (file)
@@ -25,6 +25,7 @@ KBUILD_AFLAGS   += -mbig-endian
 LINKFLAGS       += -mbig-endian
 KBUILD_LDFLAGS  += -mbig-endian
 LDFLAGS += -EB
+CHECKFLAGS     += -D_BIG_ENDIAN
 endif
 
 head-y          := arch/c6x/kernel/head.o