From patchwork Sun May 12 12:52:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 163988 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp218567ili; Sun, 12 May 2019 05:53:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8fT1kuOpXe74X5p6mhE3eHexzBDdQus0lrdUbFevWVXS+LBGz8tqZMYY8fExCE7C7/Kul X-Received: by 2002:a17:902:8343:: with SMTP id z3mr25204721pln.240.1557665621249; Sun, 12 May 2019 05:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557665621; cv=none; d=google.com; s=arc-20160816; b=yArnDrUN26x0zF5QywpmVOJC3B40cVqFDMkPYmqQHJ3rt1gFVm6EvgO/KOqCxu20uk /yb4BKwB2GX3rIoBDTsV0tR0wGL/yNuOzK60awQBT1WuVQsCSkIdicvhSSHuhMciRQDS zSv6fbLwSKD8f7N0Sum+u1FhGf8euI0TdQF95Hy/GAW2HZuH3Dd10qU6hIE29C+adF0/ O2GIatrWCYl1ceSV+3YXCnFl2HVJYvi9Wsy13w1ga31Ywqea1tiRp8I9eVjGvCmqf6cN fB/nPJ8jBYOUwjE6kKLciMFu6i+V5pLPINkR7PbXBw7qQqqlsstzZ5V7HAYRkJqPWwlJ uyZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=u+xPaVz4tIL7LFuq2RerwT0d5S+67UExAoc/i1B3fLw=; b=VBAqdwxAl6IGb+oPTzIxgOVM6mRL9w5U0udHccPUTPbiiL1eXHEO0Ag/2GevmEBZU0 FJ38ciF6shgkF0AcN+UBC4FVK0KAP4C+wFrW5e1Hm2UtD/3UP7xb8gAPjzhMq34U/LDg sNiUZPwAi6EHawr2WIOe5Tk3RljvYGlnLEIYf7bUw8Lxnz598q0+8v8EgDjdroZKHKQG QR2ruU1Du9PH6MV948UOgbHM59y4Z2RSesM3cqHczI+arbB4hOdf6a6eFa/oSd+mDRc1 sCXveTReAYkvOTwrRzHd7QvIssbHpckLFgYKuCY8dGHYr1giTOrjfqcK0TH+7PU7t3xv pPwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=pM1wbJTa; 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 q21si5643720pls.438.2019.05.12.05.53.40; Sun, 12 May 2019 05:53:41 -0700 (PDT) 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=pM1wbJTa; 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 S1726773AbfELMxj (ORCPT + 30 others); Sun, 12 May 2019 08:53:39 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:25545 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbfELMxi (ORCPT ); Sun, 12 May 2019 08:53:38 -0400 Received: from grover.flets-west.jp (softbank126125154139.bbtec.net [126.125.154.139]) (authenticated) by conuserg-08.nifty.com with ESMTP id x4CCq3eT005954; Sun, 12 May 2019 21:52:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x4CCq3eT005954 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1557665524; bh=u+xPaVz4tIL7LFuq2RerwT0d5S+67UExAoc/i1B3fLw=; h=From:To:Cc:Subject:Date:From; b=pM1wbJTa9bsV3kshrbPpP4RE0iTD+XLun3QXPATVk0lWaojkJoOYZuOxEGyczIVn4 LJTFGLo0VeeEEHqdU10DuZ9AHZnDs2DZPxtBlT/7jv8jEVLM18tRAjD872A92hCXeI Q5InFVveJdEMByh4lg243PXhpjBEHg6TY/PHbw4Cd6a8rh8AQcz+ntBb9s/A6/yykX RqQu7BZ2w/+0snJe1TLVQaMcmXWILEcgLxcLqcfWiSSFfCDOSg51jtoFeCteegRTGb uWDOrJQceHeM/RYqVTvRcZr6QZYIElebdwUbvs6sUgM3eXC60WSL41pqBXVe5el9cb HbITLlvjNlqdw== X-Nifty-SrcIP: [126.125.154.139] From: Masahiro Yamada To: x86@kernel.org, Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Ingo Molnar , Uros Bizjak Subject: [PATCH] x86: disable CONFIG_GENERIC_HWEIGHT and remove __HAVE_ARCH_SW_HWEIGHT Date: Sun, 12 May 2019 21:52:01 +0900 Message-Id: <1557665521-17570-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 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, and 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 is not necessary either. 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 4725211..3692514 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -260,9 +260,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