From patchwork Mon Feb 18 05:59:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10817367 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99A0F13B5 for ; Mon, 18 Feb 2019 06:16:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86D662A415 for ; Mon, 18 Feb 2019 06:16:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A9F12A436; Mon, 18 Feb 2019 06:16:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 233D82A415 for ; Mon, 18 Feb 2019 06:16:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727302AbfBRGQf (ORCPT ); Mon, 18 Feb 2019 01:16:35 -0500 Received: from condef-10.nifty.com ([202.248.20.75]:32255 "EHLO condef-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbfBRGQe (ORCPT ); Mon, 18 Feb 2019 01:16:34 -0500 X-Greylist: delayed 564 seconds by postgrey-1.27 at vger.kernel.org; Mon, 18 Feb 2019 01:16:33 EST Received: from conuserg-07.nifty.com ([10.126.8.70])by condef-10.nifty.com with ESMTP id x1I63EJc015585 for ; Mon, 18 Feb 2019 15:03:20 +0900 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1I617hQ006910; Mon, 18 Feb 2019 15:01:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1I617hQ006910 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550469670; bh=qOxNgKzvwDnjG50PQePnvnPUqjWVkaPbhPq17iGF30M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YYo8l7fAwJT/nx0ArY/No5xP16LoQ3HbWUe2PSY3OXR7minn3wmrACWbJVQP46EUb ZswDcrb30TOQbhhfqbbx39fmJqILnNiRlBjFFFthNsUROoQWh4+5NUjxxWz5dQp8iQ l9688rRodF0N+Lq0e3BwZWksHw4xCOHZgSmkr5XIpqrzUlPYuTLBNhcbfgYGes8aLK W3cpwF7az8tkzQR+R+c1Voco6bX3GzYy/SDYEBPyU4+uh82DDlhL0B305UuXV7B5M8 ePYFGl65I1Ti0kcbqewERUBfr/MYJWpmLu96A7NbMyHSnE/Czm/M22YmBHwAl9H2Sk MTI3qGDusKrlw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org Cc: Kalle Valo , linux-wireless@vger.kernel.org, Christoph Hellwig , Masahiro Yamada , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Bianconi , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Felix Fietkau , Matthias Brugger Subject: [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8() Date: Mon, 18 Feb 2019 14:59:30 +0900 Message-Id: <1550469571-25933-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550469571-25933-1-git-send-email-yamada.masahiro@socionext.com> References: <1550469571-25933-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __sw_hweight8() is just internal implementation. Drivers should use the common API, hweight8(). Signed-off-by: Masahiro Yamada Acked-by: Kalle Valo --- This patch should go to x86 tree along with 2/2. Otherwise, all{yes,mod}config of x86 would be broken. This patch is trivial enough. I want ACK from the net/wireless maintainer so that this can go in via x86 tree. drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 7b926df..c42e0d3 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -124,7 +124,7 @@ static void mt76_init_stream_cap(struct mt76_dev *dev, bool vht) { struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap; - int i, nstream = __sw_hweight8(dev->antenna_mask); + int i, nstream = hweight8(dev->antenna_mask); struct ieee80211_sta_vht_cap *vht_cap; u16 mcs_map = 0; From patchwork Mon Feb 18 05:59:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10817359 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E84E61390 for ; Mon, 18 Feb 2019 06:08:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D61F529F8A for ; Mon, 18 Feb 2019 06:08:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9AE42A0C8; Mon, 18 Feb 2019 06:08:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52A3429F8A for ; Mon, 18 Feb 2019 06:08:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725861AbfBRGIc (ORCPT ); Mon, 18 Feb 2019 01:08:32 -0500 Received: from condef-01.nifty.com ([202.248.20.66]:41573 "EHLO condef-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725852AbfBRGIc (ORCPT ); Mon, 18 Feb 2019 01:08:32 -0500 Received: from conuserg-07.nifty.com ([10.126.8.70])by condef-01.nifty.com with ESMTP id x1I62b2u024662 for ; Mon, 18 Feb 2019 15:02:44 +0900 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1I617hR006910; Mon, 18 Feb 2019 15:01:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1I617hR006910 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550469671; bh=+zEAAULpGTKFRc/KBt3VH/iYZzgyTO+raU+wiYUW1tI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U01fL0yMBl7DUHfNrNZj/tPwczdJrD3wj9mgLYaeSAuCULD6XSCSOZPo/NbJFZatk ibXYoSW5DH6qD4nCvfC9o+DKr0g2m5c8/OZEp4T3cvq8aMix7NdMOI3eK+SO4EqSmz OL2iQpjHoDeyqc5xYvgF4OEN6V6QMoc4Nr9uIY0inYfYaexoBLirl9h35cQhKM6TXU LjxezWLutCISTX2E4WPZGt3aa78JIiR6DSO1RKfBCEeZ1ActJevzSohFp8NFfoWoOx KIr91kSnYvvjCgonjnQSfx75FbPOW2b2RXGXEpUE2MZHG7NyguK6LRLa72PeKd5LOQ lEo00Gyivtf0Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org Cc: Kalle Valo , linux-wireless@vger.kernel.org, Christoph Hellwig , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] x86: disable CONFIG_GENERIC_HWEIGHT and remove __HAVE_ARCH_SW_HWEIGHT Date: Mon, 18 Feb 2019 14:59:31 +0900 Message-Id: <1550469571-25933-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550469571-25933-1-git-send-email-yamada.masahiro@socionext.com> References: <1550469571-25933-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP arch/x86/include/asm/arch_hweight.h uses __sw_hweight{32,64} as alternatives, but they are implemented in arch/x86/lib/hweight.S x86 does not rely on the generic C implementation lib/hweight.c at all, so CONFIG_GENERIC_HWEIGHT should be disabled. __HAVE_ARCH_SW_HWEIGHT was unneeded in the first place. Signed-off-by: Masahiro Yamada --- arch/x86/Kconfig | 3 --- arch/x86/include/asm/arch_hweight.h | 2 -- lib/hweight.c | 4 ---- 3 files changed, 9 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 6826143..c2813af 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -262,9 +262,6 @@ config GENERIC_BUG config GENERIC_BUG_RELATIVE_POINTERS bool -config GENERIC_HWEIGHT - def_bool y - config ARCH_MAY_HAVE_PC_FDC def_bool y depends on ISA_DMA_API diff --git a/arch/x86/include/asm/arch_hweight.h b/arch/x86/include/asm/arch_hweight.h index fc06935..ba88edd 100644 --- a/arch/x86/include/asm/arch_hweight.h +++ b/arch/x86/include/asm/arch_hweight.h @@ -12,8 +12,6 @@ #define REG_OUT "a" #endif -#define __HAVE_ARCH_SW_HWEIGHT - static __always_inline unsigned int __arch_hweight32(unsigned int w) { unsigned int res; diff --git a/lib/hweight.c b/lib/hweight.c index 7660d88..c94586b 100644 --- a/lib/hweight.c +++ b/lib/hweight.c @@ -10,7 +10,6 @@ * The Hamming Weight of a number is the total number of bits set in it. */ -#ifndef __HAVE_ARCH_SW_HWEIGHT unsigned int __sw_hweight32(unsigned int w) { #ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER @@ -27,7 +26,6 @@ unsigned int __sw_hweight32(unsigned int w) #endif } EXPORT_SYMBOL(__sw_hweight32); -#endif unsigned int __sw_hweight16(unsigned int w) { @@ -46,7 +44,6 @@ unsigned int __sw_hweight8(unsigned int w) } EXPORT_SYMBOL(__sw_hweight8); -#ifndef __HAVE_ARCH_SW_HWEIGHT unsigned long __sw_hweight64(__u64 w) { #if BITS_PER_LONG == 32 @@ -69,4 +66,3 @@ unsigned long __sw_hweight64(__u64 w) #endif } EXPORT_SYMBOL(__sw_hweight64); -#endif