[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191022172922.61232-9-andriy.shevchenko@linux.intel.com>
Date: Tue, 22 Oct 2019 20:29:19 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
linux-gpio@...r.kernel.org,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Yury Norov <yury.norov@...il.com>,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
William Breathitt Gray <vilhelm.gray@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v2 08/11] 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.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/gpio/gpio-pca953x.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 10b669b8f27d..5eee66269a0c 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -740,7 +740,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))
@@ -752,11 +751,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,
--
2.23.0
Powered by blists - more mailing lists