Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1241949

Re: [PATCH] arch/powerpc: provide zero_bytemask() for big-endian

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [PATCH] arch/powerpc: provide zero_bytemask() for big-endian
Date 2015-10-08 05:40 +0200
Message-ID <qhadI-8jN-5@gated-at.bofh.it> (permalink)
References <qhadI-8jN-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <sojkam1@fel.cvut.cz>
> Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
> ---
>  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 <mpe@ellerman.id.au>


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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] arch/powerpc: provide zero_bytemask() for big-endian Michael Ellerman <mpe@ellerman.id.au> - 2015-10-08 05:40 +0200

csiph-web