From: Daniel Axtens <dja@axtens.net>
To: linuxppc-dev@ozlabs.org
Cc: mpe@ellerman.id.au, Daniel Axtens <dja@axtens.net>
Subject: [PATCH 4/4] powerpc/sparse: Use LE definition of REG_BYTE
Date: Wed, 18 May 2016 11:16:52 +1000 [thread overview]
Message-ID: <1463534212-4879-4-git-send-email-dja@axtens.net> (raw)
In-Reply-To: <1463534212-4879-1-git-send-email-dja@axtens.net>
Sparse complains that it doesn't know what REG_BYTE is:
arch/powerpc/kernel/align.c:313:29: error: undefined identifier 'REG_BYTE'
arch/powerpc/kernel/align.c:320:37: error: undefined identifier 'REG_BYTE'
arch/powerpc/kernel/align.c:328:29: error: cast from unknown type
arch/powerpc/kernel/align.c:328:29: error: cast from unknown type
REG_BYTE is defined differently based on whether we're compiling for
LE, BE32 or BE64. Sparse apparently doesn't provide __BIG_ENDIAN__
or __LITTLE_ENDIAN__, so add an explicit __CHECKER__ to the LE
definition.
The choice of LE is arbitrary.
Signed-off-by: Daniel Axtens <dja@axtens.net>
---
arch/powerpc/kernel/align.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 8e7cb8e2b21a..43f745f2cea9 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -230,7 +230,7 @@ static int emulate_dcbz(struct pt_regs *regs, unsigned char __user *addr)
#endif
#endif
-#ifdef __LITTLE_ENDIAN__
+#if defined(__LITTLE_ENDIAN__) || defined(__CHECKER__)
#define REG_BYTE(rp, i) (*(((u8 *)((rp) + ((i)>>2)) + ((i)&3))))
#endif
--
2.5.0
next prev parent reply other threads:[~2016-05-18 1:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 1:16 [PATCH 1/4] powerpc/sparse: make some things static Daniel Axtens
2016-05-18 1:16 ` [PATCH 2/4] powerpc: Introduce asm-prototypes.h Daniel Axtens
2016-06-21 0:40 ` [2/4] " Michael Ellerman
2020-08-14 9:34 ` [PATCH 2/4] " Christophe Leroy
2020-08-14 9:53 ` Daniel Axtens
2020-08-14 10:41 ` Christophe Leroy
2020-08-14 13:04 ` Michael Ellerman
2020-08-14 13:26 ` Christophe Leroy
2016-05-18 1:16 ` [PATCH 3/4] powerpc/sparse: Include headers containing prototypes Daniel Axtens
2016-06-21 0:40 ` [3/4] " Michael Ellerman
2016-05-18 1:16 ` Daniel Axtens [this message]
2016-06-21 0:40 ` [1/4] powerpc/sparse: make some things static 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=1463534212-4879-4-git-send-email-dja@axtens.net \
--to=dja@axtens.net \
--cc=linuxppc-dev@ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).