Skip to content

Commit 2edba74

Browse files
andy-shevbrgl
authored andcommitted
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>
1 parent 944dcbe commit 2edba74

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpio/gpio-wcove.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ static struct irq_chip wcove_irqchip = {
324324
static irqreturn_t wcove_gpio_irq_handler(int irq, void *data)
325325
{
326326
struct wcove_gpio *wg = (struct wcove_gpio *)data;
327-
unsigned int pending, virq, gpio, mask, offset;
327+
unsigned int virq, gpio, mask, offset;
328+
unsigned long pending;
328329
u8 p[2];
329330

330331
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)
339340
/* Iterate until no interrupt is pending */
340341
while (pending) {
341342
/* One iteration is for all pending bits */
342-
for_each_set_bit(gpio, (const unsigned long *)&pending,
343-
WCOVE_GPIO_NUM) {
343+
for_each_set_bit(gpio, &pending, WCOVE_GPIO_NUM) {
344344
offset = (gpio > GROUP0_NR_IRQS) ? 1 : 0;
345345
mask = (offset == 1) ? BIT(gpio - GROUP0_NR_IRQS) :
346346
BIT(gpio);

0 commit comments

Comments
 (0)