From 8b4a16c3fe0d1edbd7228bccdf6718dc29d6cf97 Mon Sep 17 00:00:00 2001 From: Sedat Dilek Date: Sun, 13 Sep 2015 01:27:08 +0200 Subject: [PATCH] llvmlinux: Fix ARCH_HWEIGHT for compilation with clang --- arch/x86/include/asm/arch_hweight.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/arch_hweight.h b/arch/x86/include/asm/arch_hweight.h index 9686c3d9ff73..a187db48e77d 100644 --- a/arch/x86/include/asm/arch_hweight.h +++ b/arch/x86/include/asm/arch_hweight.h @@ -23,13 +23,7 @@ */ static inline unsigned int __arch_hweight32(unsigned int w) { - unsigned int res = 0; - - asm (ALTERNATIVE("call __sw_hweight32", POPCNT32, X86_FEATURE_POPCNT) - : "="REG_OUT (res) - : REG_IN (w)); - - return res; + return __sw_hweight32(w); } static inline unsigned int __arch_hweight16(unsigned int w) @@ -44,18 +38,13 @@ static inline unsigned int __arch_hweight8(unsigned int w) static inline unsigned long __arch_hweight64(__u64 w) { - unsigned long res = 0; #ifdef CONFIG_X86_32 return __arch_hweight32((u32)w) + __arch_hweight32((u32)(w >> 32)); -#else - asm (ALTERNATIVE("call __sw_hweight64", POPCNT64, X86_FEATURE_POPCNT) - : "="REG_OUT (res) - : REG_IN (w)); #endif /* CONFIG_X86_32 */ - return res; + return __sw_hweight64(w); } #endif -- 2.5.2