From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753298AbdHIUlO (ORCPT ); Wed, 9 Aug 2017 16:41:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46184 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbdHIUlM (ORCPT ); Wed, 9 Aug 2017 16:41:12 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Sojka , Michael Ellerman , Chris Metcalf Subject: [PATCH 3.18 54/92] arch/powerpc: provide zero_bytemask() for big-endian Date: Wed, 9 Aug 2017 13:37:22 -0700 Message-Id: <20170809202157.759009558@linuxfoundation.org> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170809202155.435709888@linuxfoundation.org> References: <20170809202155.435709888@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chris Metcalf commit 7a5692e6e533fd379081ab06fb58f3f5ee4d80bc upstream. For some reason, only the little-endian flavor of powerpc provided the zero_bytemask() implementation. Reported-by: Michal Sojka Acked-by: Michael Ellerman Signed-off-by: Chris Metcalf Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/word-at-a-time.h | 5 +++++ 1 file changed, 5 insertions(+) --- 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 lon return (val + c->high_bits) & ~rhs; } +static inline unsigned long zero_bytemask(unsigned long mask) +{ + return ~1ul << __fls(mask); +} + #else #ifdef CONFIG_64BIT