Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 868d6481 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

qnx4: use hweight8



Use hweight8 instead of counting for each bit

Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Acked-by: default avatarAnders Larsen <al@alarsen.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ca120b20
Loading
Loading
Loading
Loading
+1 −16
Original line number Diff line number Diff line
@@ -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;