[PATCH 3/3] kvmppc: optimize find first bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christian Ehrhardt <ehrhardt@xxxxxxxxxxxxxxxxxx>

Since we use a unsigned long here anyway we can use the optimized __ffs.

Signed-off-by: Christian Ehrhardt <ehrhardt@xxxxxxxxxxxxxxxxxx>
---

[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);
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux