On Thu, 3 Nov 2011, Russell King - ARM Linux wrote:
> stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
> while (stat) {
> while (stat) {
> irq = ffs(stat) - 1;
> stat &= ~(1 << irq);
> handle_irq(irq);
> }
> stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
> }
The inner loop could be a do { } while() construct to avoid evaluating
stat twice on each outer loop itteration. Maybe gcc is smart enough to
notice though, maybe not.
Nicolas
_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss