From: Akinobu Mita Date: Wed, 16 Dec 2009 00:48:24 +0000 (-0800) Subject: qnx4: use hweight8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=868d64812ae84e8f094e0bcf95157c7d79d625ec;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git qnx4: use hweight8 Use hweight8 instead of counting for each bit Signed-off-by: Akinobu Mita Acked-by: Anders Larsen Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/qnx4/bitmap.c b/fs/qnx4/bitmap.c index a17440bce01..22e0d60e53e 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;