powerpc/sparse: Pass endianness to sparse
authorDaniel Axtens <dja@axtens.net>
Tue, 12 Jul 2016 00:54:51 +0000 (10:54 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 14 Jul 2016 10:44:03 +0000 (20:44 +1000)
Explicitly give sparse an endianness in the Makefile, so that it
doesn't get confused.

Normally we have #ifdef one and #else the other, so it doesn't usually
matter, but we have been bitten by it before, and indeed this patch
fixes a number of sparse errors.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/Makefile

index b41f4c600a65becd3d8a4eaf72669483ee309e8c..ca254546cd05a1a4fe09e87e63945d7b38b8873f 100644 (file)
@@ -181,6 +181,11 @@ KBUILD_CFLAGS      += -pipe -Iarch/$(ARCH) $(CFLAGS-y)
 CPP            = $(CC) -E $(KBUILD_CFLAGS)
 
 CHECKFLAGS     += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
+ifdef CONFIG_CPU_BIG_ENDIAN
+CHECKFLAGS     += -D__BIG_ENDIAN__
+else
+CHECKFLAGS     += -D__LITTLE_ENDIAN__
+endif
 
 KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o