diff options
author | Felipe Balbi <balbi@ti.com> | 2012-02-22 07:53:59 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-22 08:05:11 -0400 |
commit | 5a903090e7aa561901b7f052eb744b480d6126d4 (patch) | |
tree | 9bd5b024d34e30329f3b30bbb7bbbdaf80e640d7 /drivers/mfd/twl4030-irq.c | |
parent | f01b1f90bf46ddaf2a68215a9489364c974e5689 (diff) |
mfd: Micro-optimization on twl4030 IRQ handler
__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>
Diffstat (limited to 'drivers/mfd/twl4030-irq.c')
-rw-r--r-- | drivers/mfd/twl4030-irq.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c index d6f3a5e9f7bd..3b748b71c0f3 100644 --- a/drivers/mfd/twl4030-irq.c +++ b/drivers/mfd/twl4030-irq.c | |||
@@ -293,7 +293,6 @@ static unsigned twl4030_irq_base; | |||
293 | */ | 293 | */ |
294 | static irqreturn_t handle_twl4030_pih(int irq, void *devid) | 294 | static irqreturn_t handle_twl4030_pih(int irq, void *devid) |
295 | { | 295 | { |
296 | int module_irq; | ||
297 | irqreturn_t ret; | 296 | irqreturn_t ret; |
298 | u8 pih_isr; | 297 | u8 pih_isr; |
299 | 298 | ||
@@ -304,12 +303,13 @@ static irqreturn_t handle_twl4030_pih(int irq, void *devid) | |||
304 | return IRQ_NONE; | 303 | return IRQ_NONE; |
305 | } | 304 | } |
306 | 305 | ||
307 | /* these handlers deal with the relevant SIH irq status */ | 306 | while (pih_isr) { |
308 | for (module_irq = twl4030_irq_base; | 307 | unsigned long pending = __ffs(pih_isr); |
309 | pih_isr; | 308 | unsigned int irq; |
310 | pih_isr >>= 1, module_irq++) { | 309 | |
311 | if (pih_isr & 0x1) | 310 | pih_isr &= ~BIT(pending); |
312 | handle_nested_irq(module_irq); | 311 | irq = pending + twl4030_irq_base; |
312 | handle_nested_irq(irq); | ||
313 | } | 313 | } |
314 | 314 | ||
315 | return IRQ_HANDLED; | 315 | return IRQ_HANDLED; |