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