summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-wcove.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-01-29 16:40:50 +0200
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2021-02-15 11:43:32 +0100
commit2edba74c9d3499472caf6f76e518b4d9d1b04e6e (patch)
tree881494aaeca41d498b997c9dbc2a18c853825663 /drivers/gpio/gpio-wcove.c
parent944dcbe84b8ab7efdfcc592b6905a797324da51c (diff)
gpio: wcove: Get rid of error prone casting in IRQ handler
The casting from int to long on 64-bit platform is error prone. Replace it with proper type of the variable on stack. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/gpio/gpio-wcove.c')
-rw-r--r--drivers/gpio/gpio-wcove.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 97c5f1d01b62..6b47505f4070 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -324,7 +324,8 @@ static struct irq_chip wcove_irqchip = {
static irqreturn_t wcove_gpio_irq_handler(int irq, void *data)
{
struct wcove_gpio *wg = (struct wcove_gpio *)data;
- unsigned int pending, virq, gpio, mask, offset;
+ unsigned int virq, gpio, mask, offset;
+ unsigned long pending;
u8 p[2];
if (regmap_bulk_read(wg->regmap, IRQ_STATUS_BASE, p, 2)) {
@@ -339,8 +340,7 @@ static irqreturn_t wcove_gpio_irq_handler(int irq, void *data)
/* Iterate until no interrupt is pending */
while (pending) {
/* One iteration is for all pending bits */
- for_each_set_bit(gpio, (const unsigned long *)&pending,
- WCOVE_GPIO_NUM) {
+ for_each_set_bit(gpio, &pending, WCOVE_GPIO_NUM) {
offset = (gpio > GROUP0_NR_IRQS) ? 1 : 0;
mask = (offset == 1) ? BIT(gpio - GROUP0_NR_IRQS) :
BIT(gpio);