From: Dongsheng Wang <dongsheng.wang@freescale.com>
To: <benh@kernel.crashing.org>
Cc: <scottwood@freescale.com>, <cmetcalf@ezchip.com>,
<leoli@freescale.com>, <paulus@samba.org>, <mpe@ellerman.id.au>,
<linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
Wang Dongsheng <dongsheng.wang@freescale.com>
Subject: [PATCH] powerpc: Quick fix upstream main line build error on PowerPC
Date: Fri, 9 Oct 2015 10:55:09 +0800 [thread overview]
Message-ID: <1444359309-40375-1-git-send-email-dongsheng.wang@freescale.com> (raw)
From: Wang Dongsheng <dongsheng.wang@freescale.com>
This issue caused on 'commit 990486c8af04 ("strscpy: zero any trailing
garbage bytes in the destination")'.
zero_bytemask is not implemented on PowerPC. So copy the zero_bytemask
of BIG_ENDIAN implementation from include/asm-generic/word-at-a-time.h
to arch/powerpc/include/asm/word-at-a-time.h.
Build message:
lib/string.c: In function 'strscpy':
lib/string.c:209:4: error: implicit declaration of function
'zero_bytemask' [-Werror=implicit-function-declaration]
*(unsigned long *)(dest+res) = c & zero_bytemask(data);
cc1: some warnings being treated as errors
make[1]: *** [lib/string.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
diff --git a/arch/powerpc/include/asm/word-at-a-time.h b/arch/powerpc/include/asm/word-at-a-time.h
index 5b3a903..d891456 100644
--- a/arch/powerpc/include/asm/word-at-a-time.h
+++ b/arch/powerpc/include/asm/word-at-a-time.h
@@ -40,6 +40,10 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct
return (val + c->high_bits) & ~rhs;
}
+#ifndef zero_bytemask
+#define zero_bytemask(mask) (~1ul << __fls(mask))
+#endif
+
#else
#ifdef CONFIG_64BIT
--
2.1.0.27.g96db324
next reply other threads:[~2015-10-09 3:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 2:55 Dongsheng Wang [this message]
2015-10-09 14:24 ` [PATCH] powerpc: Quick fix upstream main line build error on PowerPC Chris Metcalf
2015-10-10 6:19 ` Aneesh Kumar K.V
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=1444359309-40375-1-git-send-email-dongsheng.wang@freescale.com \
--to=dongsheng.wang@freescale.com \
--cc=benh@kernel.crashing.org \
--cc=cmetcalf@ezchip.com \
--cc=leoli@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=scottwood@freescale.com \
/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).