Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <arnd@arndb.de>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Daniel Axtens and committed by
Michael Ellerman
62c2c5cf f8750513

+5
+5
arch/powerpc/Makefile
··· 181 181 CPP = $(CC) -E $(KBUILD_CFLAGS) 182 182 183 183 CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ 184 + ifdef CONFIG_CPU_BIG_ENDIAN 185 + CHECKFLAGS += -D__BIG_ENDIAN__ 186 + else 187 + CHECKFLAGS += -D__LITTLE_ENDIAN__ 188 + endif 184 189 185 190 KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o 186 191