From: ehrhardt@linux.vnet.ibm.com
To: kvm-ppc@vger.kernel.org
Subject: [PATCH 3/3] kvmppc: optimize find first bit
Date: Mon, 13 Oct 2008 12:07:41 +0000 [thread overview]
Message-ID: <1223899663-23210-2-git-send-email-ehrhardt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1223636372-8946-2-git-send-email-ehrhardt@linux.vnet.ibm.com>
From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Since we use a unsigned long here anyway we can use the optimized __ffs.
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---
[diffstat]
booke_guest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[diff]
diff --git a/arch/powerpc/kvm/booke_guest.c b/arch/powerpc/kvm/booke_guest.c
--- a/arch/powerpc/kvm/booke_guest.c
+++ b/arch/powerpc/kvm/booke_guest.c
@@ -180,7 +180,7 @@
unsigned int prio;
u32 mask;
- prio = find_first_bit(pending, BITS_PER_BYTE * sizeof(*pending));
+ prio = __ffs(*pending);
while (prio <= BOOKE_MAX_INTERRUPT) {
if (kvmppc_can_deliver_interrupt_by_prio(vcpu, prio, &mask)) {
kvmppc_clear_exception_by_prio(pending, prio);
prev parent reply other threads:[~2008-10-13 12:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-10 10:59 [PATCH 3/3] kvmppc: optimize find first bit ehrhardt
2008-10-10 18:23 ` Hollis Blanchard
2008-10-13 12:07 ` ehrhardt [this message]
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=1223899663-23210-2-git-send-email-ehrhardt@linux.vnet.ibm.com \
--to=ehrhardt@linux.vnet.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.