diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-01-29 21:01:30 +0200 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-02-08 15:55:39 +0200 |
commit | 1147575447f988e605c182fa940b1cc4d8c59dce (patch) | |
tree | 989528dfd72e5c8ee6ea8840672917464e251077 /drivers/gpio | |
parent | 282db906eecccb08b8f0adccd082a129ae1d95d8 (diff) |
gpio: msic: Remove duplicate check in IRQ handler
There is no need to check for non-zero pending since for_each_set_bit() does it
on the first iteration.
While here, drop redundant assignment.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-msic.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c index 3b34dbecef99..138569f8f16e 100644 --- a/drivers/gpio/gpio-msic.c +++ b/drivers/gpio/gpio-msic.c @@ -237,20 +237,17 @@ static void msic_gpio_irq_handler(struct irq_desc *desc) struct msic_gpio *mg = irq_data_get_irq_handler_data(data); struct irq_chip *chip = irq_data_get_irq_chip(data); struct intel_msic *msic = pdev_to_intel_msic(mg->pdev); + unsigned long pending; int i; int bitnr; u8 pin; - unsigned long pending = 0; for (i = 0; i < (mg->chip.ngpio / BITS_PER_BYTE); i++) { intel_msic_irq_read(msic, INTEL_MSIC_GPIO0LVIRQ + i, &pin); pending = pin; - if (pending) { - for_each_set_bit(bitnr, &pending, BITS_PER_BYTE) - generic_handle_irq(mg->irq_base + - (i * BITS_PER_BYTE) + bitnr); - } + for_each_set_bit(bitnr, &pending, BITS_PER_BYTE) + generic_handle_irq(mg->irq_base + i * BITS_PER_BYTE + bitnr); } chip->irq_eoi(data); } |