Skip to contentSkip to conversation

gpio: ath79: Fix fall-through warning for Clang

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Nov 19, 2020 – Dec 1, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: ath79: Fix fall-through warning for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword to indicate that the code is intended to fall through to the next case.

---
 drivers/gpio/gpio-ath79.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-ath79.c +1 -0
index d5359341cc6b..678ddd375891 100644
@@ -123,6 +123,7 @@ static int ath79_gpio_irq_set_type(struct irq_data *data,
 	switch (flow_type) {
 	case IRQ_TYPE_EDGE_RISING:
 		polarity |= mask;
+		fallthrough;
 	case IRQ_TYPE_EDGE_FALLING:
 	case IRQ_TYPE_EDGE_BOTH:
 		break;
Signature · 1 line
2.27.0
#1 lore raw
Quoted 24 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword to indicate that the code is intended to fall through to the next case.

---
 drivers/gpio/gpio-ath79.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-ath79.c +1 -1
index d5359341cc6b..678ddd375891 100644
@@ -123,6 +123,7 @@ static int ath79_gpio_irq_set_type(struct irq_data *data,
        switch (flow_type) {
        case IRQ_TYPE_EDGE_RISING:
                polarity |= mask;
+               fallthrough;
        case IRQ_TYPE_EDGE_FALLING:
        case IRQ_TYPE_EDGE_BOTH:
                break;
--
Quoted 2 lines

2.27.0

Applied, thanks!

Bartosz