Skip to content

Commit a97832f

Browse files
andy-shevtorvalds
authored andcommitted
gpio: pca953x: remove redundant variable and check in IRQ handler
We always will have at least one iteration of the loop due to pending being guaranteed to be non-zero. That is, we may remove extra variable and check in the IRQ handler. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Thomas Petazzoni <[email protected]> Cc: William Breathitt Gray <[email protected]> Cc: Yury Norov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 30544ed commit a97832f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/gpio/gpio-pca953x.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
743743
struct pca953x_chip *chip = devid;
744744
u8 pending[MAX_BANK];
745745
u8 level;
746-
unsigned nhandled = 0;
747746
int i;
748747

749748
if (!pca953x_irq_pending(chip, pending))
@@ -755,11 +754,10 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
755754
handle_nested_irq(irq_find_mapping(chip->gpio_chip.irq.domain,
756755
level + (BANK_SZ * i)));
757756
pending[i] &= ~(1 << level);
758-
nhandled++;
759757
}
760758
}
761759

762-
return (nhandled > 0) ? IRQ_HANDLED : IRQ_NONE;
760+
return IRQ_HANDLED;
763761
}
764762

765763
static int pca953x_irq_setup(struct pca953x_chip *chip,

0 commit comments

Comments
 (0)