]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: mvebu: Slightly optimize mvebu_gpio_irq_handler()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 19 Oct 2025 08:31:38 +0000 (10:31 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 20 Oct 2025 08:24:03 +0000 (10:24 +0200)
In the main loop of mvebu_gpio_irq_handler() some calls to
irq_find_mapping() can be saved.

There is no point to find an irq number before checking if this something
has to be done.
By testing first, some calls can be saved.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/7190f5def0489ed3f40435449c86cd7c710e6dd4.1760862679.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-mvebu.c

index ac799fced950e306a967d1965a13f8e1802e77b4..22c36b79e249ff1ee6f93fda763ee58ff907e845 100644 (file)
@@ -573,11 +573,10 @@ static void mvebu_gpio_irq_handler(struct irq_desc *desc)
        for (i = 0; i < mvchip->chip.ngpio; i++) {
                int irq;
 
-               irq = irq_find_mapping(mvchip->domain, i);
-
                if (!(cause & BIT(i)))
                        continue;
 
+               irq = irq_find_mapping(mvchip->domain, i);
                type = irq_get_trigger_type(irq);
                if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
                        /* Swap polarity (race with GPIO line) */