diff mbox series

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

Message ID 20240701170249.8128-19-kabel@kernel.org (mailing list archive)
State Superseded
Headers show
Series armada-370-xp irqchip updates round 2 | expand

Commit Message

Marek Behún July 1, 2024, 5:02 p.m. UTC
Refactor the mpic_reenable_percpu() function to make it simpler.

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

Comments

Andrew Lunn July 3, 2024, 1:33 a.m. UTC | #1
On Mon, Jul 01, 2024 at 07:02:42PM +0200, Marek Behún wrote:
> Refactor the mpic_reenable_percpu() function to make it simpler.
> 
> Signed-off-by: Marek Behún <kabel@kernel.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
diff mbox series

Patch

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())