All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@lists.ozlabs.org
Cc: Daniel Axtens <dja@axtens.net>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc/align: Use #ifdef __BIG_ENDIAN__ #else for REG_BYTE
Date: Fri, 17 Jun 2016 12:46:44 +0200	[thread overview]
Message-ID: <7459954.Ax6T6W22CJ@wuerfel> (raw)
In-Reply-To: <8760t8mqrc.fsf@possimpible.ozlabs.ibm.com>

On Friday, June 17, 2016 1:35:35 PM CEST Daniel Axtens wrote:
> > It would be better to fix the sparse compilation so the same endianess
> > is set that you get when calling gcc.
> 
> I will definitely work on a patch to sparse! I'd still like this or
> something like it to go in though, so we can keep working on reducing
> the sparse warning count while the sparse patch is in the works.

I think you just need to fix the Makefile so it sets the right
arguments when calling sparse.

Something like the (untested) patch below, similar to how we
already handle the word size and how some other architectures
handle setting __BIG_ENDIAN__.

	Arnd

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
 

  reply	other threads:[~2016-06-17 10:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 12:33 [PATCH] powerpc/align: Use #ifdef __BIG_ENDIAN__ #else for REG_BYTE Michael Ellerman
2016-06-16 13:05 ` Arnd Bergmann
2016-06-17  3:35   ` Daniel Axtens
2016-06-17 10:46     ` Arnd Bergmann [this message]
2016-06-21  0:51       ` Michael Ellerman
2016-06-21  9:04         ` Arnd Bergmann
2016-06-21  1:11       ` Daniel Axtens
2016-06-17  5:35   ` Michael Ellerman
2016-06-21  0:40 ` 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=7459954.Ax6T6W22CJ@wuerfel \
    --to=arnd@arndb.de \
    --cc=dja@axtens.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.