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: 158572 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2117695jaa; Sun, 17 Feb 2019 22:03:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IaMLjUk7nrO1R16oy1W2PmflWtFQXgsAI4lyGdF7Tu8d9sPNN1Xk7+RnEB+qn0LXiQb//A6 X-Received: by 2002:a62:68c5:: with SMTP id d188mr23115596pfc.194.1550469808805; Sun, 17 Feb 2019 22:03:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550469808; cv=none; d=google.com; s=arc-20160816; b=LC8arTpp7iLtLfsRGiUU2ugXDIUuY552HLYMhl2r31Q4kZCN0viAZeXLZxxb97Gp3z f/32g8O6IKU+EMy0i7fOr0vnm0BpxduQbSq9DG3wNdpD1PiHPBtkILkEriQe/ujjZote ELW8pUvZr4SEC5Bzoo1MljjJhANaLutAGrOxmh5bGkAbyyGoayzJQ1qW+UYy77AXZ1Bx +QAK8X8EJf0FSvf/QMY/Uav3l0yPbI+tsKQtc4nGvUuIbh34YDcIlvvjo+YownBRnxGw l++H3Y/VSivklgbI6oX9vHcriRSibj84jqu141u1q9pL544HGFh6sN8wJRE0SmfhJJrJ C8zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=qOxNgKzvwDnjG50PQePnvnPUqjWVkaPbhPq17iGF30M=; b=MtJQ6DdQmW45cxhurhufUys5ZF2Lyd7KNFStPqnm2d8yUi70CBuulxETKukwWERfiF LLZIQSlstGcxmiu4GAiiOepqUevTDVuhLu1PKS2X3gK8iNAuac+o5vo3eN+/71gKeD1r 9VgTBkVoY1c6PfEErzxnvRlS4ic2JT+BgBBxqcieb/NYStA8nGHV5E3ZDDR1U+TZlbd8 FpJPJXKGwvy5BPTo70vs6MOoO8ehagu6/d2Ci52zrmzy9rwpswH0HyI0i3iNjzvJfHqF 3ReR/p4dNueXo1PaOtVBs9KS2ptoodOnuebZCJeo3Eb9RDRPvZY6Li92a4O/CRpbSCbY hBIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=YYo8l7fA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61si13070949pld.347.2019.02.17.22.03.28; Sun, 17 Feb 2019 22:03:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=YYo8l7fA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728125AbfBRGDU (ORCPT + 32 others); Mon, 18 Feb 2019 01:03:20 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:23763 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726286AbfBRGDU (ORCPT ); Mon, 18 Feb 2019 01:03:20 -0500 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __sw_hweight8() is just internal implementation. Drivers should use the common API, hweight8(). Signed-off-by: Masahiro Yamada --- 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(-) -- 2.7.4 Acked-by: Kalle Valo 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: 158570 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2117084jaa; Sun, 17 Feb 2019 22:02:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IbKk3GxN9w7GD2HVsVuRIIEKjY5PEQRszSNih2c/0DlYpMkYPajsybBnDH/OCKH93kCB6xN X-Received: by 2002:a17:902:684:: with SMTP id 4mr23410908plh.3.1550469771695; Sun, 17 Feb 2019 22:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550469771; cv=none; d=google.com; s=arc-20160816; b=OQgVyMq3ae3OSQqNapsjfTrRJwZ55V2PC1Vpc1CW2fmqDUA8BNZ847LpHlgQjfiuwR z68ABKWQQwdEyzFMGqesj50miR9/t/0Q/8lH4x4UjTE/8CDgkWqnXGS8VwbDfQwGYQHJ AMdsop3f6RCb65iODJa1WNdQYzC436qqn0VGNcEj3gnYGytn6Ldy53WWVbuu7GfkSKvP 6UKS/70B/P4LDgiLdIrZ0ULUmZdZCeQxSNlIQWZxtpsog1BSKoyxVwuly5uCidCtZLhB kQtHKMONOKtw19bK6iK3fOnno+/KuK3oLba4mS4JmINKTWaYeBbmUyl+/ywcWXrAN9rW l/rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=+zEAAULpGTKFRc/KBt3VH/iYZzgyTO+raU+wiYUW1tI=; b=kShWpVP7cHqIEAtNA4026fSdkipx4ca6y0tMzuk+n0+YH0aNWpCqGVWvArHQQkHQpc Xo5NjoufUz7FftAaD1bnHTgAcbUCd+FeF9tzAoa9hNaK8xSAKmPf2W95efXWCEDMwh25 YeaOKaa66xRzV2T9Aa2rpqESMB2rXGpKfdW0vxlRda2h/gJBHR+UPQg/OHWMoewoxR3O Bo1iWUmqyP0o1+PTyVzw1FgeB9IbgOvUOLqK0CODN5ntq6O/c1MoX/Eky7T8lvIaSoDl HtXIrsmp9dGCf4Bot7vJmntkEDU3+tq4MAX51njo0NyGmXh/LQQRjYf5pa9xrsDaw0FU WH0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=U01fL0yM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si10955921pgi.146.2019.02.17.22.02.50; Sun, 17 Feb 2019 22:02:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=U01fL0yM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727935AbfBRGCo (ORCPT + 32 others); Mon, 18 Feb 2019 01:02:44 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:22595 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727422AbfBRGCo (ORCPT ); Mon, 18 Feb 2019 01:02:44 -0500 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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