Skip to contentSkip to conversation

gpiolib: acpi: Fix fall-through warnings for Clang

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

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

PATCH 1/1 gpiolib: acpi: Fix fall-through warnings for Clang

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.

---
 drivers/gpio/gpiolib-acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpiolib-acpi.c +1 -0
index 6cc5f91bfe2e..e37a57d0a2f0 100644
@@ -233,6 +233,7 @@ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Gustavo A. R. Silva

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.

Quoted 21 lines
---
 drivers/gpio/gpiolib-acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpiolib-acpi.c +1 -1
index 6cc5f91bfe2e..e37a57d0a2f0 100644
@@ -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

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 28 lines · Andy Shevchenko
Quoted 4 lines · Gustavo A. R. Silva

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.

Quoted 18 lines
---
 drivers/gpio/gpiolib-acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpiolib-acpi.c +1 -0
index 6cc5f91bfe2e..e37a57d0a2f0 100644
@@ -233,6 +233,7 @@ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
                default:
                        break;
                }
+               break;
        default:
                break;
        }
Quoted 8 lines
Quoted 3 lines

--
2.27.0

--
With Best Regards,
Andy Shevchenko

Are you taking it through your tree?

Bartosz

#3 lore raw
Quoted 19 lines · Bartosz Golaszewski
Quoted 16 lines · Andy Shevchenko
Quoted 4 lines · Gustavo A. R. Silva

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.

Quoted 6 lines
---
 drivers/gpio/gpiolib-acpi.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 14 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpio/gpiolib-acpi.c +0 -0
index 6cc5f91bfe2e..e37a57d0a2f0 100644
Quoted 8 lines

drivers/gpio/gpiolib-acpi.c acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity) · line 239

Quoted 8 lines
drivers/gpio/gpiolib-acpi.c +1 -0
@@ -233,6 +233,7 @@ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
                default:
                        break;
                }
+               break;
        default:
                break;
        }

Are you taking it through your tree?

I don't have anything else, so please proceed directly. That's why I gave the tag.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
In reply to Gustavo A. R. Silva
Quoted 24 lines · Gustavo A. R. Silva

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.

---
 drivers/gpio/gpiolib-acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpiolib-acpi.c +1 -1
index 6cc5f91bfe2e..e37a57d0a2f0 100644
@@ -233,6 +233,7 @@ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
                default:
                        break;
                }
+               break;
        default:
                break;
        }
--
Quoted 2 lines

2.27.0

Applied, thanks!

Bartosz