Skip to content

Commit

Permalink
mfd: Micro-optimization on twl4030 IRQ handler
Browse files Browse the repository at this point in the history
__ffs() will be far faster than the for loop used.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Felipe Balbi authored and Samuel Ortiz committed Mar 22, 2012
1 parent f01b1f9 commit 5a90309
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/mfd/twl4030-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ static unsigned twl4030_irq_base;
*/
static irqreturn_t handle_twl4030_pih(int irq, void *devid)
{
int module_irq;
irqreturn_t ret;
u8 pih_isr;

Expand All @@ -304,12 +303,13 @@ static irqreturn_t handle_twl4030_pih(int irq, void *devid)
return IRQ_NONE;
}

/* these handlers deal with the relevant SIH irq status */
for (module_irq = twl4030_irq_base;
pih_isr;
pih_isr >>= 1, module_irq++) {
if (pih_isr & 0x1)
handle_nested_irq(module_irq);
while (pih_isr) {
unsigned long pending = __ffs(pih_isr);
unsigned int irq;

pih_isr &= ~BIT(pending);
irq = pending + twl4030_irq_base;
handle_nested_irq(irq);
}

return IRQ_HANDLED;
Expand Down

0 comments on commit 5a90309

Please sign in to comment.