Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: mvebu: Slightly optimize mvebu_gpio_irq_handler()

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>

authored by

Christophe JAILLET and committed by
Bartosz Golaszewski
eb7f1c84 6f5976c0

+1 -2
+1 -2
drivers/gpio/gpio-mvebu.c
··· 573 573 for (i = 0; i < mvchip->chip.ngpio; i++) { 574 574 int irq; 575 575 576 - irq = irq_find_mapping(mvchip->domain, i); 577 - 578 576 if (!(cause & BIT(i))) 579 577 continue; 580 578 579 + irq = irq_find_mapping(mvchip->domain, i); 581 580 type = irq_get_trigger_type(irq); 582 581 if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { 583 582 /* Swap polarity (race with GPIO line) */