mirror of
https://github.com/S3NEO/android_kernel_samsung_msm8226.git
synced 2024-11-07 03:47:13 +00:00
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>
This commit is contained in:
parent
ca120b20c3
commit
868d64812a
1 changed files with 1 additions and 16 deletions
|
@ -28,22 +28,7 @@ static void count_bits(register const char *bmPart, register int size,
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
b = *bmPart++;
|
b = *bmPart++;
|
||||||
if ((b & 1) == 0)
|
tot += 8 - hweight8(b);
|
||||||
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++;
|
|
||||||
size--;
|
size--;
|
||||||
} while (size != 0);
|
} while (size != 0);
|
||||||
*tf = tot;
|
*tf = tot;
|
||||||
|
|
Loading…
Reference in a new issue