From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbbJJGUl (ORCPT ); Sat, 10 Oct 2015 02:20:41 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:50835 "EHLO e23smtp05.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775AbbJJGUk (ORCPT ); Sat, 10 Oct 2015 02:20:40 -0400 X-Helo: d23dlp03.au.ibm.com X-MailFrom: aneesh.kumar@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org From: "Aneesh Kumar K.V" To: Dongsheng Wang , benh@kernel.crashing.org Cc: linux-kernel@vger.kernel.org, Wang Dongsheng , 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 In-Reply-To: <1444359309-40375-1-git-send-email-dongsheng.wang@freescale.com> References: <1444359309-40375-1-git-send-email-dongsheng.wang@freescale.com> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Sat, 10 Oct 2015 11:49:40 +0530 Message-ID: <87pp0nz1mr.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15101006-0017-0000-0000-000001FF196D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dongsheng Wang writes: > From: Wang Dongsheng > > 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 > > 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