summaryrefslogtreecommitdiffstats
path: root/fs/qnx4/bitmap.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2009-12-16 01:48:24 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 16:20:18 +0100
commit868d64812ae84e8f094e0bcf95157c7d79d625ec (patch)
treed4788544d0ea0143022150eb765f52cb2801073d /fs/qnx4/bitmap.c
parentqnx4fs: remove remains of the (defunct) write support (diff)
downloadlinux-868d64812ae84e8f094e0bcf95157c7d79d625ec.tar.xz
linux-868d64812ae84e8f094e0bcf95157c7d79d625ec.zip
qnx4: use hweight8
Use hweight8 instead of counting for each bit Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Anders Larsen <al@alarsen.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--fs/qnx4/bitmap.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/fs/qnx4/bitmap.c b/fs/qnx4/bitmap.c
index a17440bce018..22e0d60e53ef 100644
--- a/fs/qnx4/bitmap.c
+++ b/fs/qnx4/bitmap.c
@@ -28,22 +28,7 @@ static void count_bits(register const char *bmPart, register int size,
}
do {
b = *bmPart++;
- if ((b & 1) == 0)
- tot++;
- if ((b & 2) == 0)
- tot++;
- if ((b & 4) == 0)
- tot++;
- if ((b & 8) == 0)
- tot++;
- if ((b & 16) == 0)
- tot++;
- if ((b & 32) == 0)
- tot++;
- if ((b & 64) == 0)
- tot++;
- if ((b & 128) == 0)
- tot++;
+ tot += 8 - hweight8(b);
size--;
} while (size != 0);
*tf = tot;