KVM: ppc: optimize find first bit

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

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Hollis Blanchard 2008-11-05 09:36:22 -06:00 коммит произвёл Avi Kivity
Родитель 1b6766c7f3
Коммит 9ab80843c0
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -222,7 +222,7 @@ void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu)
unsigned int exception; unsigned int exception;
unsigned int priority; unsigned int priority;
priority = find_first_bit(pending, BITS_PER_BYTE * sizeof(*pending)); priority = __ffs(*pending);
while (priority <= BOOKE_MAX_INTERRUPT) { while (priority <= BOOKE_MAX_INTERRUPT) {
exception = priority_exception[priority]; exception = priority_exception[priority];
if (kvmppc_can_deliver_interrupt(vcpu, exception)) { if (kvmppc_can_deliver_interrupt(vcpu, exception)) {