[PATCH 18/25] irqchip/armada-370-xp: Simplify mpic_reenable_percpu() code

Marek Behún kabel at kernel.org
Mon Jul 1 10:02:42 PDT 2024


Refactor the mpic_reenable_percpu() function to make it simpler.

Signed-off-by: Marek Behún <kabel at kernel.org>
---
 drivers/irqchip/irq-armada-370-xp.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 9e8b189da1d1..d21216515fc2 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -528,20 +528,13 @@ static void mpic_smp_cpu_init(void)
 static void mpic_reenable_percpu(void)
 {
 	/* Re-enable per-CPU interrupts that were enabled before suspend */
-	for (unsigned int irq = 0; irq < MPIC_MAX_PER_CPU_IRQS; irq++) {
-		struct irq_data *data;
-		int virq;
+	for (irq_hw_number_t i = 0; i < MPIC_MAX_PER_CPU_IRQS; i++) {
+		unsigned int virq = irq_linear_revmap(mpic_domain, i);
 
-		virq = irq_linear_revmap(mpic_domain, irq);
-		if (!virq)
-			continue;
-
-		data = irq_get_irq_data(virq);
-
-		if (!irq_percpu_is_enabled(virq))
+		if (!virq || !irq_percpu_is_enabled(virq))
 			continue;
 
-		mpic_irq_unmask(data);
+		mpic_irq_unmask(irq_get_irq_data(virq));
 	}
 
 	if (mpic_is_ipi_available())
-- 
2.44.2




More information about the linux-arm-kernel mailing list