Skip to content

Commit a924eae

Browse files
yashshah7linusw
authored andcommitted
gpio: sifive: fix static checker warning
Typcasting "irq_state" leads to the below static checker warning: The fix is to declare "irq_state" as unsigned long instead of u32. drivers/gpio/gpio-sifive.c:97 sifive_gpio_irq_enable() warn: passing casted pointer '&chip->irq_state' to 'assign_bit()' 32 vs 64. Fixes: 96868dc ("gpio/sifive: Add GPIO driver for SiFive SoCs") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Yash Shah <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Marc Zyngier <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 2d5a2f9 commit a924eae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpio/gpio-sifive.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct sifive_gpio {
3535
void __iomem *base;
3636
struct gpio_chip gc;
3737
struct regmap *regs;
38-
u32 irq_state;
38+
unsigned long irq_state;
3939
unsigned int trigger[SIFIVE_GPIO_MAX];
4040
unsigned int irq_parent[SIFIVE_GPIO_MAX];
4141
};
@@ -94,7 +94,7 @@ static void sifive_gpio_irq_enable(struct irq_data *d)
9494
spin_unlock_irqrestore(&gc->bgpio_lock, flags);
9595

9696
/* Enable interrupts */
97-
assign_bit(offset, (unsigned long *)&chip->irq_state, 1);
97+
assign_bit(offset, &chip->irq_state, 1);
9898
sifive_gpio_set_ie(chip, offset);
9999
}
100100

@@ -104,7 +104,7 @@ static void sifive_gpio_irq_disable(struct irq_data *d)
104104
struct sifive_gpio *chip = gpiochip_get_data(gc);
105105
int offset = irqd_to_hwirq(d) % SIFIVE_GPIO_MAX;
106106

107-
assign_bit(offset, (unsigned long *)&chip->irq_state, 0);
107+
assign_bit(offset, &chip->irq_state, 0);
108108
sifive_gpio_set_ie(chip, offset);
109109
irq_chip_disable_parent(d);
110110
}

0 commit comments

Comments
 (0)