From: Daniel Axtens Date: Tue, 12 Jul 2016 00:54:51 +0000 (+1000) Subject: powerpc/sparse: Pass endianness to sparse X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=62c2c5cf387beb4bbf45045c3041dc9cfb40e5df;p=linux-beck.git powerpc/sparse: Pass endianness to sparse 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 Signed-off-by: Daniel Axtens Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index b41f4c600a65..ca254546cd05 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -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