* [PATCH] powerpc: Quick fix upstream main line build error on PowerPC
@ 2015-10-09 2:55 Dongsheng Wang
2015-10-09 14:24 ` Chris Metcalf
2015-10-10 6:19 ` Aneesh Kumar K.V
0 siblings, 2 replies; 3+ messages in thread
From: Dongsheng Wang @ 2015-10-09 2:55 UTC (permalink / raw)
To: benh
Cc: scottwood, cmetcalf, leoli, paulus, mpe, linuxppc-dev,
linux-kernel, Wang Dongsheng
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: Quick fix upstream main line build error on PowerPC
2015-10-09 2:55 [PATCH] powerpc: Quick fix upstream main line build error on PowerPC Dongsheng Wang
@ 2015-10-09 14:24 ` Chris Metcalf
2015-10-10 6:19 ` Aneesh Kumar K.V
1 sibling, 0 replies; 3+ messages in thread
From: Chris Metcalf @ 2015-10-09 14:24 UTC (permalink / raw)
To: Dongsheng Wang, benh
Cc: scottwood, leoli, paulus, mpe, linuxppc-dev, linux-kernel
On 10/08/2015 10:55 PM, Dongsheng Wang wrote:
> 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.
Thanks; a fix is already queued for Linus.
--
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: Quick fix upstream main line build error on PowerPC
2015-10-09 2:55 [PATCH] powerpc: Quick fix upstream main line build error on PowerPC Dongsheng Wang
2015-10-09 14:24 ` Chris Metcalf
@ 2015-10-10 6:19 ` Aneesh Kumar K.V
1 sibling, 0 replies; 3+ messages in thread
From: Aneesh Kumar K.V @ 2015-10-10 6:19 UTC (permalink / raw)
To: Dongsheng Wang, benh
Cc: linux-kernel, Wang Dongsheng, cmetcalf, paulus, scottwood,
linuxppc-dev
Dongsheng Wang <dongsheng.wang@freescale.com> writes:
> 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
Why #ifndef zero_bytemask ?. What will override zero_bytemask defined in
arch headers. We generally do it such that generic code does #ifndef, but arch
headers doesn't need to do this.
-aneesh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-10 6:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-09 2:55 [PATCH] powerpc: Quick fix upstream main line build error on PowerPC Dongsheng Wang
2015-10-09 14:24 ` Chris Metcalf
2015-10-10 6:19 ` Aneesh Kumar K.V
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).