Skip to contentSkip to conversation

pinctrl: rockchip: Mark expected switch fall-through

PATCH In review Anders Roxell 2 participants 2 messages Jul 26, 2019 – Aug 5, 2019

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

PATCH 1/2 pinctrl: rockchip: Mark expected switch fall-through

When fall-through warnings was enabled by default the following warning was starting to show up:

../drivers/pinctrl/pinctrl-rockchip.c: In function ‘rockchip_gpio_set_config’:
../drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall
through [-Wimplicit-fallthrough=]
rockchip_gpio_set_debounce(gc, offset, true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/pinctrl/pinctrl-rockchip.c:2795:2: note: here
default:
^~~~~~~

Rework so that the compiler doesn't warn about fall-through. Add 'return -ENOTSUPP;' to match the comment.

Fixes d93512ef0f0e ("Makefile: Globally enable fall-through warning")
---
 drivers/pinctrl/pinctrl-rockchip.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/pinctrl-rockchip.c +1 -0
index 62a622159006..dc0bbf198cbc 100644
@@ -2792,6 +2792,7 @@ static int rockchip_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
 		 * still return -ENOTSUPP as before, to make sure the caller
 		 * of gpiod_set_debounce won't change its behaviour.
 		 */
+		return -ENOTSUPP;
 	default:
 		return -ENOTSUPP;
 	}
Signature · 1 line
2.20.1
#1 lore raw
Quoted 12 lines · Anders Roxell

When fall-through warnings was enabled by default the following warning was starting to show up:

../drivers/pinctrl/pinctrl-rockchip.c: In function ‘rockchip_gpio_set_config’:
../drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall
through [-Wimplicit-fallthrough=]

   rockchip_gpio_set_debounce(gc, offset, true);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../drivers/pinctrl/pinctrl-rockchip.c:2795:2: note: here
default:
^~~~~~~

Quoted 5 lines

Rework so that the compiler doesn't warn about fall-through. Add 'return -ENOTSUPP;' to match the comment.

Fixes d93512ef0f0e ("Makefile: Globally enable fall-through warning")

Patch applied.

Yours,
Linus Walleij