summaryrefslogtreecommitdiff
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-06-19 21:34:42 +0000
committerJason Cooper <jason@lakedaemon.net>2014-06-24 12:38:17 +0000
commit25dc49e3321a3b3f17b3f78297432073bb14ec0b (patch)
treeee75af1081476b887aea9d6f0d4e1924e5c44197 /drivers/irqchip
parent97dcc21bd3dc7f04a48ff37700ae838feb35fca4 (diff)
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: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20140619212713.662897061@linutronix.de Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/spear-shirq.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/irqchip/spear-shirq.c b/drivers/irqchip/spear-shirq.c
index 2a33129c4f4b..8521a7295b02 100644
--- a/drivers/irqchip/spear-shirq.c
+++ b/drivers/irqchip/spear-shirq.c
@@ -224,23 +224,20 @@ static void shirq_handler(unsigned irq, struct irq_desc *desc)
struct spear_shirq *shirq = irq_get_handler_data(irq);
struct irq_data *idata = irq_desc_get_irq_data(desc);
struct irq_chip *chip = irq_data_get_irq_chip(idata);
- u32 i, j, val, mask;
+ u32 pend;
chip->irq_ack(idata);
- mask = shirq->mask;
- while ((val = readl(shirq->base + shirq->regs.status_reg) &
- mask)) {
+ pend = readl(shirq->base + shirq->regs.status_reg) & shirq->mask;
+ pend >>= shirq->offset;
- val >>= shirq->offset;
- for (i = 0, j = 1; i < shirq->nr_irqs; i++, j <<= 1) {
+ while (pend) {
+ int irq = __ffs(pend);
- if (!(j & val))
- continue;
-
- generic_handle_irq(shirq->virq_base + i);
- }
+ pend &= ~(0x1 << irq);
+ generic_handle_irq(shirq->virq_base + irq);
}
+
chip->irq_unmask(idata);
}