diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2014-06-19 17:34:42 -0400 |
|---|---|---|
| committer | Jason Cooper <jason@lakedaemon.net> | 2014-06-24 08:38:17 -0400 |
| commit | 25dc49e3321a3b3f17b3f78297432073bb14ec0b (patch) | |
| tree | ee75af1081476b887aea9d6f0d4e1924e5c44197 | |
| parent | 97dcc21bd3dc7f04a48ff37700ae838feb35fca4 (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>
| -rw-r--r-- | drivers/irqchip/spear-shirq.c | 19 |
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) | |||
| 224 | struct spear_shirq *shirq = irq_get_handler_data(irq); | 224 | struct spear_shirq *shirq = irq_get_handler_data(irq); |
| 225 | struct irq_data *idata = irq_desc_get_irq_data(desc); | 225 | struct irq_data *idata = irq_desc_get_irq_data(desc); |
| 226 | struct irq_chip *chip = irq_data_get_irq_chip(idata); | 226 | struct irq_chip *chip = irq_data_get_irq_chip(idata); |
| 227 | u32 i, j, val, mask; | 227 | u32 pend; |
| 228 | 228 | ||
| 229 | chip->irq_ack(idata); | 229 | chip->irq_ack(idata); |
| 230 | 230 | ||
| 231 | mask = shirq->mask; | 231 | pend = readl(shirq->base + shirq->regs.status_reg) & shirq->mask; |
| 232 | while ((val = readl(shirq->base + shirq->regs.status_reg) & | 232 | pend >>= shirq->offset; |
| 233 | mask)) { | ||
| 234 | 233 | ||
| 235 | val >>= shirq->offset; | 234 | while (pend) { |
| 236 | for (i = 0, j = 1; i < shirq->nr_irqs; i++, j <<= 1) { | 235 | int irq = __ffs(pend); |
| 237 | 236 | ||
| 238 | if (!(j & val)) | 237 | pend &= ~(0x1 << irq); |
| 239 | continue; | 238 | generic_handle_irq(shirq->virq_base + irq); |
| 240 | |||
| 241 | generic_handle_irq(shirq->virq_base + i); | ||
| 242 | } | ||
| 243 | } | 239 | } |
| 240 | |||
| 244 | chip->irq_unmask(idata); | 241 | chip->irq_unmask(idata); |
| 245 | } | 242 | } |
| 246 | 243 | ||
