From: Changhwan Youn Date: Wed, 29 Sep 2010 11:31:42 +0000 (+0900) Subject: ARM: S5PV310: Optimize interrupt source searching code X-Git-Tag: firefly_0821_release~7613^2~3546^2^2~2^2~80 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0c0f909689c8387265a3682d4205c063071ec36a;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Changhwan Youn Signed-off-by: Kukjin Kim --- 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) 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))