aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-05-12 08:52:01 -0400
committerIngo Molnar <mingo@kernel.org>2019-05-13 05:07:33 -0400
commit409ca45526a428620d8efb362ccfd4b1e6b80642 (patch)
tree661224b2fd02f0e2026bb1ee612738ddf2268031
parenteccd906484d1cd4b5da00f093d678badb6f48f28 (diff)
x86/kconfig: Disable CONFIG_GENERIC_HWEIGHT and remove __HAVE_ARCH_SW_HWEIGHT
Remove an unnecessary arch complication: 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. No change in functionality intended. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Uros Bizjak <ubizjak@gmail.com> Link: http://lkml.kernel.org/r/1557665521-17570-1-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/Kconfig3
-rw-r--r--arch/x86/include/asm/arch_hweight.h2
-rw-r--r--lib/hweight.c4
3 files changed, 0 insertions, 9 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0a3cc347143f..de071d7e67b6 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -261,9 +261,6 @@ config GENERIC_BUG
261config GENERIC_BUG_RELATIVE_POINTERS 261config GENERIC_BUG_RELATIVE_POINTERS
262 bool 262 bool
263 263
264config GENERIC_HWEIGHT
265 def_bool y
266
267config ARCH_MAY_HAVE_PC_FDC 264config ARCH_MAY_HAVE_PC_FDC
268 def_bool y 265 def_bool y
269 depends on ISA_DMA_API 266 depends on ISA_DMA_API
diff --git a/arch/x86/include/asm/arch_hweight.h b/arch/x86/include/asm/arch_hweight.h
index fc0693569f7a..ba88edd0d58b 100644
--- a/arch/x86/include/asm/arch_hweight.h
+++ b/arch/x86/include/asm/arch_hweight.h
@@ -12,8 +12,6 @@
12#define REG_OUT "a" 12#define REG_OUT "a"
13#endif 13#endif
14 14
15#define __HAVE_ARCH_SW_HWEIGHT
16
17static __always_inline unsigned int __arch_hweight32(unsigned int w) 15static __always_inline unsigned int __arch_hweight32(unsigned int w)
18{ 16{
19 unsigned int res; 17 unsigned int res;
diff --git a/lib/hweight.c b/lib/hweight.c
index 7660d88fd496..c94586b62551 100644
--- a/lib/hweight.c
+++ b/lib/hweight.c
@@ -10,7 +10,6 @@
10 * The Hamming Weight of a number is the total number of bits set in it. 10 * The Hamming Weight of a number is the total number of bits set in it.
11 */ 11 */
12 12
13#ifndef __HAVE_ARCH_SW_HWEIGHT
14unsigned int __sw_hweight32(unsigned int w) 13unsigned int __sw_hweight32(unsigned int w)
15{ 14{
16#ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER 15#ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER
@@ -27,7 +26,6 @@ unsigned int __sw_hweight32(unsigned int w)
27#endif 26#endif
28} 27}
29EXPORT_SYMBOL(__sw_hweight32); 28EXPORT_SYMBOL(__sw_hweight32);
30#endif
31 29
32unsigned int __sw_hweight16(unsigned int w) 30unsigned int __sw_hweight16(unsigned int w)
33{ 31{
@@ -46,7 +44,6 @@ unsigned int __sw_hweight8(unsigned int w)
46} 44}
47EXPORT_SYMBOL(__sw_hweight8); 45EXPORT_SYMBOL(__sw_hweight8);
48 46
49#ifndef __HAVE_ARCH_SW_HWEIGHT
50unsigned long __sw_hweight64(__u64 w) 47unsigned long __sw_hweight64(__u64 w)
51{ 48{
52#if BITS_PER_LONG == 32 49#if BITS_PER_LONG == 32
@@ -69,4 +66,3 @@ unsigned long __sw_hweight64(__u64 w)
69#endif 66#endif
70} 67}
71EXPORT_SYMBOL(__sw_hweight64); 68EXPORT_SYMBOL(__sw_hweight64);
72#endif