Skip to content

Commit

Permalink
x86/kconfig: Disable CONFIG_GENERIC_HWEIGHT and remove __HAVE_ARCH_SW…
Browse files Browse the repository at this point in the history
…_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 <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Uros Bizjak <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
masahir0y authored and Ingo Molnar committed May 13, 2019
1 parent eccd906 commit 409ca45
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,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
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/include/asm/arch_hweight.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions lib/hweight.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,7 +26,6 @@ unsigned int __sw_hweight32(unsigned int w)
#endif
}
EXPORT_SYMBOL(__sw_hweight32);
#endif

unsigned int __sw_hweight16(unsigned int w)
{
Expand All @@ -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
Expand All @@ -69,4 +66,3 @@ unsigned long __sw_hweight64(__u64 w)
#endif
}
EXPORT_SYMBOL(__sw_hweight64);
#endif

0 comments on commit 409ca45

Please sign in to comment.