diff options
author | Changhwan Youn <chaos.youn@samsung.com> | 2010-09-29 07:31:42 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-10-20 18:52:18 -0400 |
commit | 0c0f909689c8387265a3682d4205c063071ec36a (patch) | |
tree | 3d341bd807e1bd050a393ee3ead44ff87bcda036 /arch/arm/mach-s5pv310 | |
parent | 8d75c9128a07bd1f81952a518ed818d1a3e90c96 (diff) |
ARM: S5PV310: Optimize interrupt source searching code
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>
Diffstat (limited to 'arch/arm/mach-s5pv310')
-rw-r--r-- | arch/arm/mach-s5pv310/irq-combiner.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/arm/mach-s5pv310/irq-combiner.c b/arch/arm/mach-s5pv310/irq-combiner.c index 0f7052164f23..c3f88c3faf6c 100644 --- a/arch/arm/mach-s5pv310/irq-combiner.c +++ b/arch/arm/mach-s5pv310/irq-combiner.c | |||
@@ -66,11 +66,7 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) | |||
66 | if (status == 0) | 66 | if (status == 0) |
67 | goto out; | 67 | goto out; |
68 | 68 | ||
69 | for (combiner_irq = 0; combiner_irq < 32; combiner_irq++) { | 69 | combiner_irq = __ffs(status); |
70 | if (status & 0x1) | ||
71 | break; | ||
72 | status >>= 1; | ||
73 | } | ||
74 | 70 | ||
75 | cascade_irq = combiner_irq + (chip_data->irq_offset & ~31); | 71 | cascade_irq = combiner_irq + (chip_data->irq_offset & ~31); |
76 | if (unlikely(cascade_irq >= NR_IRQS)) | 72 | if (unlikely(cascade_irq >= NR_IRQS)) |