Skip to content

Commit

Permalink
qnx4: use hweight8
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Dec 16, 2009
1 parent ca120b2 commit 868d648
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions fs/qnx4/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 868d648

Please sign in to comment.