From: Akinobu Mita <akinobu.mita@gmail.com>
To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
Anders Larsen <al@alarsen.net>, Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH] qnx4: Use hweight8
Date: Fri, 13 Nov 2009 16:06:18 +0900 [thread overview]
Message-ID: <1258095978-13380-1-git-send-email-akinobu.mita@gmail.com> (raw)
Use hweight8 instead of counting for each bit
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Anders Larsen <al@alarsen.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
---
fs/qnx4/bitmap.c | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
diff --git a/fs/qnx4/bitmap.c b/fs/qnx4/bitmap.c
index 0afba06..b913e3d 100644
--- a/fs/qnx4/bitmap.c
+++ b/fs/qnx4/bitmap.c
@@ -35,22 +35,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 += hweight8(b);
size--;
} while (size != 0);
*tf = tot;
--
1.6.5.1
next reply other threads:[~2009-11-13 7:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 7:06 Akinobu Mita [this message]
2009-11-13 9:25 ` Anders Larsen
2009-11-13 9:57 ` [PATCH v2] " Akinobu Mita
2009-11-13 10:11 ` Anders Larsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1258095978-13380-1-git-send-email-akinobu.mita@gmail.com \
--to=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=al@alarsen.net \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®