pinctrl: apple: use modulo rather than bitwise and
authorJoey Gouly <joey.gouly@arm.com>
Sun, 21 Nov 2021 16:56:41 +0000 (16:56 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 26 Nov 2021 23:55:14 +0000 (00:55 +0100)
This expresses the intention clearer.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20211121165642.27883-11-joey.gouly@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-apple-gpio.c

index 8e794eb..8a58c86 100644 (file)
@@ -252,7 +252,7 @@ static void apple_gpio_irq_ack(struct irq_data *data)
        struct apple_gpio_pinctrl *pctl = gpiochip_get_data(irq_data_get_irq_chip_data(data));
        unsigned int irqgrp = FIELD_GET(REG_GPIOx_GRP, apple_gpio_get_reg(pctl, data->hwirq));
 
-       writel(BIT(data->hwirq & 31), pctl->base + REG_IRQ(irqgrp, data->hwirq));
+       writel(BIT(data->hwirq % 32), pctl->base + REG_IRQ(irqgrp, data->hwirq));
 }
 
 static unsigned int apple_gpio_irq_type(unsigned int type)