All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Dongsheng Wang <dongsheng.wang@freescale.com>, benh@kernel.crashing.org
Cc: linux-kernel@vger.kernel.org,
	Wang Dongsheng <dongsheng.wang@freescale.com>,
	cmetcalf@ezchip.com, paulus@samba.org, scottwood@freescale.com,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: Quick fix upstream main line build error on PowerPC
Date: Sat, 10 Oct 2015 11:49:40 +0530	[thread overview]
Message-ID: <87pp0nz1mr.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1444359309-40375-1-git-send-email-dongsheng.wang@freescale.com>

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
  

      parent reply	other threads:[~2015-10-10  6:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=87pp0nz1mr.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=cmetcalf@ezchip.com \
    --cc=dongsheng.wang@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --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 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.