diff mbox series

[next] gpiolib: acpi: Fix fall-through warnings for Clang

Message ID 20201119170739.GA22665@embeddedor
State New
Headers show
Series [next] gpiolib: acpi: Fix fall-through warnings for Clang | expand

Commit Message

Gustavo A. R. Silva Nov. 19, 2020, 5:07 p.m. UTC
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a break statement instead of letting the code 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/gpiolib-acpi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andy Shevchenko Nov. 19, 2020, 6:47 p.m. UTC | #1
On Thu, Nov 19, 2020 at 7: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 break statement instead of letting the code fall
> through to the next case.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
>  drivers/gpio/gpiolib-acpi.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index 6cc5f91bfe2e..e37a57d0a2f0 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -233,6 +233,7 @@ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
>                 default:
>                         break;
>                 }
> +               break;
>         default:
>                 break;
>         }
> --
> 2.27.0
>
Bartosz Golaszewski Nov. 30, 2020, 4:51 p.m. UTC | #2
On Thu, Nov 19, 2020 at 7:46 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>

> On Thu, Nov 19, 2020 at 7: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 break statement instead of letting the code fall

> > through to the next case.

>

> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

>

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

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

> > ---

> >  drivers/gpio/gpiolib-acpi.c | 1 +

> >  1 file changed, 1 insertion(+)

> >

> > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c

> > index 6cc5f91bfe2e..e37a57d0a2f0 100644

> > --- a/drivers/gpio/gpiolib-acpi.c

> > +++ b/drivers/gpio/gpiolib-acpi.c

> > @@ -233,6 +233,7 @@ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)

> >                 default:

> >                         break;

> >                 }

> > +               break;

> >         default:

> >                 break;

> >         }

> > --

> > 2.27.0

> >

>

>

> --

> With Best Regards,

> Andy Shevchenko


Are you taking it through your tree?

Bartosz
Bartosz Golaszewski Dec. 1, 2020, 2:48 p.m. UTC | #3
On Thu, Nov 19, 2020 at 6:07 PM Gustavo A. R. Silva
<gustavoars@kernel.org> wrote:
>
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
> by explicitly adding a break statement instead of letting the code 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/gpiolib-acpi.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index 6cc5f91bfe2e..e37a57d0a2f0 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -233,6 +233,7 @@ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
>                 default:
>                         break;
>                 }
> +               break;
>         default:
>                 break;
>         }
> --
> 2.27.0
>

Applied, thanks!

Bartosz
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 6cc5f91bfe2e..e37a57d0a2f0 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -233,6 +233,7 @@  acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}