Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: qcom: spmi-gpio: Mark expected switch fall-through

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>

authored by

Anders Roxell and committed by
Linus Walleij
6161dc03 cd927f14

+2
+2
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 813 813 switch (subtype) { 814 814 case PMIC_GPIO_SUBTYPE_GPIO_4CH: 815 815 pad->have_buffer = true; 816 + /* Fall through */ 816 817 case PMIC_GPIO_SUBTYPE_GPIOC_4CH: 817 818 pad->num_sources = 4; 818 819 break; 819 820 case PMIC_GPIO_SUBTYPE_GPIO_8CH: 820 821 pad->have_buffer = true; 822 + /* Fall through */ 821 823 case PMIC_GPIO_SUBTYPE_GPIOC_8CH: 822 824 pad->num_sources = 8; 823 825 break;