Skip to contentSkip to conversation

ARM: S5PV310: Optimize interrupt source searching code

PATCH New Kukjin Kim 1 participant 1 message Sep 28, 2010

Subsystems (3)
lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

PATCH v2 1/1 ARM: S5PV310: Optimize interrupt source searching code

From: Changhwan Youn <[email protected]>

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.

---
Changes since v1:
- Modified to ffs as per Troy Kisky's pointing out
In this case, the ffs is more suitable according to original code.

 arch/arm/mach-s5pv310/irq-combiner.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
arch/arm/mach-s5pv310/irq-combiner.c +1 -5
index 0f70521..c3f88c3 100644
@@ -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))
Signature · 1 line
1.6.2.5