Commit 25dc49e3 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Jason Cooper

irqchip: spear_shirq: Simplify chained handler

I don't know if there are less efficient ways to code that. Get rid of
the loop mess and use efficient code.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20140619212713.662897061@linutronix.deAcked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
parent 97dcc21b
...@@ -224,23 +224,20 @@ static void shirq_handler(unsigned irq, struct irq_desc *desc) ...@@ -224,23 +224,20 @@ static void shirq_handler(unsigned irq, struct irq_desc *desc)
struct spear_shirq *shirq = irq_get_handler_data(irq); struct spear_shirq *shirq = irq_get_handler_data(irq);
struct irq_data *idata = irq_desc_get_irq_data(desc); struct irq_data *idata = irq_desc_get_irq_data(desc);
struct irq_chip *chip = irq_data_get_irq_chip(idata); struct irq_chip *chip = irq_data_get_irq_chip(idata);
u32 i, j, val, mask; u32 pend;
chip->irq_ack(idata); chip->irq_ack(idata);
mask = shirq->mask; pend = readl(shirq->base + shirq->regs.status_reg) & shirq->mask;
while ((val = readl(shirq->base + shirq->regs.status_reg) & pend >>= shirq->offset;
mask)) {
val >>= shirq->offset; while (pend) {
for (i = 0, j = 1; i < shirq->nr_irqs; i++, j <<= 1) { int irq = __ffs(pend);
if (!(j & val)) pend &= ~(0x1 << irq);
continue; generic_handle_irq(shirq->virq_base + irq);
generic_handle_irq(shirq->virq_base + i);
}
} }
chip->irq_unmask(idata); chip->irq_unmask(idata);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment