提交 868d6481 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

qnx4: use hweight8

Use hweight8 instead of counting for each bit
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Acked-by: NAnders Larsen <al@alarsen.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ca120b20
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册