All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] kvmppc: optimize find first bit
@ 2008-10-10 10:59 ehrhardt
  2008-10-10 18:23 ` Hollis Blanchard
  2008-10-13 12:07 ` ehrhardt
  0 siblings, 2 replies; 3+ messages in thread
From: ehrhardt @ 2008-10-10 10:59 UTC (permalink / raw)
  To: kvm-ppc

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]

[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
@@ -227,7 +227,7 @@
 	unsigned long *pending = &vcpu->arch.pending_exceptions;
 	unsigned int priority;
 
-	priority = find_first_bit(pending, BITS_PER_BYTE * sizeof(*pending));
+	priority = __ffs(*pending);
 	while (priority <= BOOKE_MAX_INTERRUPT) {
 		if (kvmppc_can_deliver_interrupt_by_prio(vcpu, priority)) {
 			kvmppc_clear_exception_by_prio(pending, priority);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-13 12:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.