diff options
Diffstat (limited to 'lib/hweight.c')
-rw-r--r-- | lib/hweight.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hweight.c b/lib/hweight.c index b7d81ba143d1..9a5c1f221558 100644 --- a/lib/hweight.c +++ b/lib/hweight.c | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | unsigned int __sw_hweight32(unsigned int w) | 12 | unsigned int __sw_hweight32(unsigned int w) |
13 | { | 13 | { |
14 | #ifdef ARCH_HAS_FAST_MULTIPLIER | 14 | #ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER |
15 | w -= (w >> 1) & 0x55555555; | 15 | w -= (w >> 1) & 0x55555555; |
16 | w = (w & 0x33333333) + ((w >> 2) & 0x33333333); | 16 | w = (w & 0x33333333) + ((w >> 2) & 0x33333333); |
17 | w = (w + (w >> 4)) & 0x0f0f0f0f; | 17 | w = (w + (w >> 4)) & 0x0f0f0f0f; |
@@ -49,7 +49,7 @@ unsigned long __sw_hweight64(__u64 w) | |||
49 | return __sw_hweight32((unsigned int)(w >> 32)) + | 49 | return __sw_hweight32((unsigned int)(w >> 32)) + |
50 | __sw_hweight32((unsigned int)w); | 50 | __sw_hweight32((unsigned int)w); |
51 | #elif BITS_PER_LONG == 64 | 51 | #elif BITS_PER_LONG == 64 |
52 | #ifdef ARCH_HAS_FAST_MULTIPLIER | 52 | #ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER |
53 | w -= (w >> 1) & 0x5555555555555555ul; | 53 | w -= (w >> 1) & 0x5555555555555555ul; |
54 | w = (w & 0x3333333333333333ul) + ((w >> 2) & 0x3333333333333333ul); | 54 | w = (w & 0x3333333333333333ul) + ((w >> 2) & 0x3333333333333333ul); |
55 | w = (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0ful; | 55 | w = (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0ful; |