kvmppc: optimize find first bit
Subsystems (2)
PATCH 3/3 kvmppc: optimize find first bit
From: Christian Ehrhardt <[email protected]>
Since we use a unsigned long here anyway we can use the optimized __ffs.
Signed-off-by Christian Ehrhardt <[email protected]>
---
[diffstat]
[diff]
arch/powerpc/kvm/booke_guest.c +1 -1
@@ -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);
Quoted 3 lines · On Fri, 2008-10-10 at 12:59 +0200, [email protected] wrote:
From: Christian Ehrhardt <[email protected]>
Since we use a unsigned long here anyway we can use the optimized
__ffs.
Looks good.
Signature · 2 lines
Hollis Blanchard IBM Linux Technology Center
PATCH 3/3 kvmppc: optimize find first bit
In reply to [email protected]From: Christian Ehrhardt <[email protected]>
Since we use a unsigned long here anyway we can use the optimized __ffs.
Signed-off-by Christian Ehrhardt <[email protected]>
---
[diffstat]
booke_guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[diff]
arch/powerpc/kvm/booke_guest.c +1 -1
@@ -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);