Skip to contentSkip to conversation

drivers/gpio : Remove redundant clearing of IRQ_TYPE_SENSE_MASK

PATCH In review Lizhe 2 participants 2 messages May 19, 2023 – May 23, 2023

Subsystems (5)
lore
Share & tools
lore

Lizhe

author
#0 lore raw

PATCH 1/1 drivers/gpio : Remove redundant clearing of IRQ_TYPE_SENSE_MASK

Before executing microchip_sgpio_irq_set_type(),
type has already been cleared IRQ_TYPE_SENSE_MASK, see __irq_set_trigger().

---
 arch/arm/plat-orion/gpio.c | 1 -
 drivers/gpio/gpio-mvebu.c  | 1 -
 2 files changed, 2 deletions(-)
arch/arm/plat-orion/gpio.c +0 -1
index 595e9cb33c1d..863fa497b1a2 100644
@@ -364,7 +364,6 @@ static int gpio_irq_set_type(struct irq_data *d, u32 type)
 		return -EINVAL;
 	}
 
-	type &= IRQ_TYPE_SENSE_MASK;
 	if (type == IRQ_TYPE_NONE)
 		return -EINVAL;
 
drivers/gpio/gpio-mvebu.c +0 -1
index a68f682aec01..34fd007b0308 100644
@@ -505,7 +505,6 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 	if ((u & BIT(pin)) == 0)
 		return -EINVAL;
 
-	type &= IRQ_TYPE_SENSE_MASK;
 	if (type == IRQ_TYPE_NONE)
 		return -EINVAL;
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 35 lines · Lizhe

Before executing microchip_sgpio_irq_set_type(),
type has already been cleared IRQ_TYPE_SENSE_MASK, see __irq_set_trigger().

---
 arch/arm/plat-orion/gpio.c | 1 -
 drivers/gpio/gpio-mvebu.c  | 1 -
 2 files changed, 2 deletions(-)
arch/arm/plat-orion/gpio.c +0 -1
index 595e9cb33c1d..863fa497b1a2 100644
@@ -364,7 +364,6 @@ static int gpio_irq_set_type(struct irq_data *d, u32 type)
                return -EINVAL;
        }
 
-       type &= IRQ_TYPE_SENSE_MASK;
        if (type == IRQ_TYPE_NONE)
                return -EINVAL;
 
drivers/gpio/gpio-mvebu.c +0 -2
index a68f682aec01..34fd007b0308 100644
@@ -505,7 +505,6 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
        if ((u & BIT(pin)) == 0)
                return -EINVAL;
 
-       type &= IRQ_TYPE_SENSE_MASK;
        if (type == IRQ_TYPE_NONE)
                return -EINVAL;
 
--
Quoted 2 lines

2.34.1

Please split it into two patches. I can apply the second part but arch/arm is beyond my jurisdiction.

While at it: is this platform even used at all? If so, then maybe we could migrate this driver to drivers/gpio/?

Bart

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel