Skip to content

Commit

Permalink
gpio: pca953x: remove redundant variable and check in IRQ handler
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
andy-shev authored and torvalds committed Dec 5, 2019
1 parent 30544ed commit a97832f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/gpio/gpio-pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
struct pca953x_chip *chip = devid;
u8 pending[MAX_BANK];
u8 level;
unsigned nhandled = 0;
int i;

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

return (nhandled > 0) ? IRQ_HANDLED : IRQ_NONE;
return IRQ_HANDLED;
}

static int pca953x_irq_setup(struct pca953x_chip *chip,
Expand Down

0 comments on commit a97832f

Please sign in to comment.