pinctrl: qcom: spmi-gpio: Mark expected switch fall-through
authorAnders Roxell <anders.roxell@linaro.org>
Fri, 26 Jul 2019 11:28:16 +0000 (13:28 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 5 Aug 2019 10:33:28 +0000 (12:33 +0200)
When fall-through warnings was enabled by default the following warnings
was starting to show up:

../drivers/pinctrl/qcom/pinctrl-spmi-gpio.c: In function ‘pmic_gpio_populate’:
../drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:815:20: warning: this statement may fall
 through [-Wimplicit-fallthrough=]
   pad->have_buffer = true;
   ~~~~~~~~~~~~~~~~~^~~~~~
../drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:816:2: note: here
  case PMIC_GPIO_SUBTYPE_GPIOC_4CH:
  ^~~~
../drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:820:20: warning: this statement may fall
 through [-Wimplicit-fallthrough=]
   pad->have_buffer = true;
   ~~~~~~~~~~~~~~~~~^~~~~~
../drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:821:2: note: here
  case PMIC_GPIO_SUBTYPE_GPIOC_8CH:
  ^~~~

Rework so that the compiler doesn't warn about fall-through.

Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://lore.kernel.org/r/20190726112816.19723-1-anders.roxell@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c

index f39da87ea1850aa840827148ebe8e4147da81e19..ebf33f65c1bced1dd72b3c94eb9c5bff5ecf275d 100644 (file)
@@ -813,11 +813,13 @@ static int pmic_gpio_populate(struct pmic_gpio_state *state,
        switch (subtype) {
        case PMIC_GPIO_SUBTYPE_GPIO_4CH:
                pad->have_buffer = true;
+               /* Fall through */
        case PMIC_GPIO_SUBTYPE_GPIOC_4CH:
                pad->num_sources = 4;
                break;
        case PMIC_GPIO_SUBTYPE_GPIO_8CH:
                pad->have_buffer = true;
+               /* Fall through */
        case PMIC_GPIO_SUBTYPE_GPIOC_8CH:
                pad->num_sources = 8;
                break;