diff mbox series

[next] gpio: ath79: Fix fall-through warning for Clang

Message ID 20201119170901.GA22703@embeddedor
State Accepted
Commit d49ee56292d7d11586efd0b4feaafafc36d54101
Headers show
Series [next] gpio: ath79: Fix fall-through warning for Clang | expand

Commit Message

Gustavo A. R. Silva Nov. 19, 2020, 5:09 p.m. UTC
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.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/gpio/gpio-ath79.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bartosz Golaszewski Dec. 1, 2020, 2:50 p.m. UTC | #1
On Thu, Nov 19, 2020 at 6:08 PM Gustavo A. R. Silva
<gustavoars@kernel.org> wrote:
>

> 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.

>

> Link: https://github.com/KSPP/linux/issues/115

> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

> ---

>  drivers/gpio/gpio-ath79.c | 1 +

>  1 file changed, 1 insertion(+)

>

> diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c

> index d5359341cc6b..678ddd375891 100644

> --- a/drivers/gpio/gpio-ath79.c

> +++ b/drivers/gpio/gpio-ath79.c

> @@ -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;

> --

> 2.27.0

>


Applied, thanks!

Bartosz
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index d5359341cc6b..678ddd375891 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -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;