arm: vgic: Use find_first_bit instead of find_next_bit when possible
authorArtem Mygaiev <artem_mygaiev@epam.com>
Thu, 24 May 2018 18:54:38 +0000 (11:54 -0700)
committerJulien Grall <julien.grall@arm.com>
Tue, 5 Jun 2018 17:14:12 +0000 (18:14 +0100)
find_next_bit(foo, sz, 0) is equivalent to find_first_bit(foo, sz). The
latter is easier to understand. Some architecture may also have a
optimized version of find_first_bit(...). So replace the occurrence of
find_next_bit in vgic_vcpu_pending_irq()."

Signed-off-by: Artem Mygaiev <artem_mygaiev@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/gic-vgic.c

index d831b3552518f108e7604aab2b2b353438f21d78..fd63906e9bc01070b703aa7c785b9b1da6b5939c 100644 (file)
@@ -362,7 +362,7 @@ int vgic_vcpu_pending_irq(struct vcpu *v)
     ASSERT(v == current);
 
     mask_priority = gic_hw_ops->read_vmcr_priority();
-    active_priority = find_next_bit(&apr, 32, 0);
+    active_priority = find_first_bit(&apr, 32);
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);