Skip to content

Commit

Permalink
ARM: S5PV310: Optimize interrupt source searching code
Browse files Browse the repository at this point in the history
It is reported by Junseok Jung that using clz instruction is
better instead of using for-loop to find the interrupt source.
This patch modifies interrupt source searching code using __ffs().
The __ffs() is implemented using clz instruction.

Suggested-by: Junseok Jung <jundols.jung@samsung.com>
Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
  • Loading branch information
Changhwan Youn authored and Kukjin Kim committed Oct 20, 2010
1 parent 8d75c91 commit 0c0f909
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions arch/arm/mach-s5pv310/irq-combiner.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
if (status == 0)
goto out;

for (combiner_irq = 0; combiner_irq < 32; combiner_irq++) {
if (status & 0x1)
break;
status >>= 1;
}
combiner_irq = __ffs(status);

cascade_irq = combiner_irq + (chip_data->irq_offset & ~31);
if (unlikely(cascade_irq >= NR_IRQS))
Expand Down

0 comments on commit 0c0f909

Please sign in to comment.