summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hweight.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-26 13:33:39 +0100
committerTakashi Iwai <tiwai@suse.de>2015-01-26 13:33:39 +0100
commit6715f728c8b080ab85db0f93f5d9fa6c7d9e906b (patch)
tree79229726e196fdfe48c6c117125cda7ef1eca4b4 /tools/perf/util/hweight.c
parent6455931186bff407493135e74c5f32efd30860e2 (diff)
parent88343ee38d7ae55e39cda74c5d137cb2c454e66c (diff)
downloadlinux-6715f728c8b080ab85db0f93f5d9fa6c7d9e906b.tar.bz2
Merge tag 'asoc-v3.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.19 There's a lot more fixes here than I'd like since I've been lax in sending things throughout the release cycle but there's only two in generic code and they've had quite some time to cook in -next so hopefully on balance are OK. The two generic fixes are a fix for crashes on capture DAIs in the compress code and a fix for error handling on probe failures which would have been harmless in the past but now oopses with the new dynamic probe code.
Diffstat (limited to 'tools/perf/util/hweight.c')
-rw-r--r--tools/perf/util/hweight.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/tools/perf/util/hweight.c b/tools/perf/util/hweight.c
deleted file mode 100644
index 5c1d0d099f0d..000000000000
--- a/tools/perf/util/hweight.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <linux/bitops.h>
-
-/**
- * hweightN - returns the hamming weight of a N-bit word
- * @x: the word to weigh
- *
- * The Hamming Weight of a number is the total number of bits set in it.
- */
-
-unsigned int hweight32(unsigned int w)
-{
- unsigned int res = w - ((w >> 1) & 0x55555555);
- res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
- res = (res + (res >> 4)) & 0x0F0F0F0F;
- res = res + (res >> 8);
- return (res + (res >> 16)) & 0x000000FF;
-}
-
-unsigned long hweight64(__u64 w)
-{
-#if BITS_PER_LONG == 32
- return hweight32((unsigned int)(w >> 32)) + hweight32((unsigned int)w);
-#elif BITS_PER_LONG == 64
- __u64 res = w - ((w >> 1) & 0x5555555555555555ul);
- res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul);
- res = (res + (res >> 4)) & 0x0F0F0F0F0F0F0F0Ful;
- res = res + (res >> 8);
- res = res + (res >> 16);
- return (res + (res >> 32)) & 0x00000000000000FFul;
-#endif
-}