From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752145AbbJHDji (ORCPT ); Wed, 7 Oct 2015 23:39:38 -0400 Received: from ozlabs.org ([103.22.144.67]:53032 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046AbbJHDjh (ORCPT ); Wed, 7 Oct 2015 23:39:37 -0400 Message-ID: <1444275575.9940.4.camel@ellerman.id.au> Subject: Re: [PATCH] arch/powerpc: provide zero_bytemask() for big-endian From: Michael Ellerman To: Chris Metcalf Cc: Michal Sojka , Ingo Molnar , Linus Torvalds , "H. Peter Anvin" , Philippe Bergheaud , Benjamin Herrenschmidt , Paul Mackerras , "David S. Miller" , Anton Blanchard , Linux Kernel Mailing List Date: Thu, 08 Oct 2015 14:39:35 +1100 In-Reply-To: <1444229188-19640-1-git-send-email-cmetcalf@ezchip.com> References: <1444229188-19640-1-git-send-email-cmetcalf@ezchip.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-10-07 at 10:46 -0400, Chris Metcalf wrote: > For some reason, only the little-endian flavor of > powerpc provided the zero_bytemask() implementation. Because previously it was optional unless DCACHE_WORD_ACCESS was enabled. > Reported-by: Michal Sojka > Signed-off-by: Chris Metcalf > --- > arch/powerpc/include/asm/word-at-a-time.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/powerpc/include/asm/word-at-a-time.h b/arch/powerpc/include/asm/word-at-a-time.h > index 5b3a903adae6..e4396a7d0f7c 100644 > --- a/arch/powerpc/include/asm/word-at-a-time.h > +++ b/arch/powerpc/include/asm/word-at-a-time.h > @@ -40,6 +40,11 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct > return (val + c->high_bits) & ~rhs; > } > > +static inline unsigned long zero_bytemask(unsigned long mask) > +{ > + return ~1ul << __fls(mask); > +} > + > #else > > #ifdef CONFIG_64BIT This looks right, and I tested it too so have an ack if you want it: Acked-by: Michael Ellerman If you can CC linuxppc-dev@lists.ozlabs.org in future on powerpc patches I'll notice them quicker, I know I was CC'ed on this but because it also went to LKML it got put in my lkml folder. cheers