From: Daniel Axtens <dja@axtens.net>
To: linuxppc-dev@ozlabs.org
Cc: arnd@arndb.de, Daniel Axtens <dja@axtens.net>
Subject: [PATCH v2 4/5] powerpc/sparse: Pass endianness to sparse
Date: Tue, 12 Jul 2016 10:54:51 +1000 [thread overview]
Message-ID: <1468284892-27765-4-git-send-email-dja@axtens.net> (raw)
In-Reply-To: <1468284892-27765-1-git-send-email-dja@axtens.net>
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>
---
arch/powerpc/Makefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 709a22a3e824..8617c71c3bdb 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
--
2.1.4
next prev parent reply other threads:[~2016-07-12 0:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 0:54 [PATCH v2 1/5] powerpc/kvm: Clarify __user annotations Daniel Axtens
2016-07-12 0:54 ` [PATCH v2 2/5] powerpc/xics: Fully qualify cast to silence sparse Daniel Axtens
2016-07-12 0:54 ` [PATCH v2 3/5] powerpc/kernel: Clean up some sparse warnings Daniel Axtens
2016-07-12 0:54 ` Daniel Axtens [this message]
2016-07-15 10:53 ` [v2,4/5] powerpc/sparse: Pass endianness to sparse Michael Ellerman
2016-07-12 0:54 ` [PATCH v2 5/5] powerpc/sparse: Make ppc_md.{halt, restart} __noreturn Daniel Axtens
2016-07-15 10:53 ` [v2,5/5] " Michael Ellerman
2016-07-15 10:53 ` [v2,1/5] powerpc/kvm: Clarify __user annotations Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468284892-27765-4-git-send-email-dja@axtens.net \
--to=dja@axtens.net \
--cc=arnd@arndb.de \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).