* [PATCH 1/2] pinctrl: rockchip: Mark expected switch fall-through
@ 2019-07-26 11:28 Anders Roxell
2019-08-05 10:32 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Anders Roxell @ 2019-07-26 11:28 UTC (permalink / raw)
To: linus.walleij, heiko
Cc: bjorn.andersson, agross, linux-gpio, linux-arm-kernel,
linux-rockchip, linux-kernel, 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:
^~~~~~~
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")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
drivers/pinctrl/pinctrl-rockchip.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 62a622159006..dc0bbf198cbc 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -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;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] pinctrl: rockchip: Mark expected switch fall-through
2019-07-26 11:28 [PATCH 1/2] pinctrl: rockchip: Mark expected switch fall-through Anders Roxell
@ 2019-08-05 10:32 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2019-08-05 10:32 UTC (permalink / raw)
To: Anders Roxell
Cc: Heiko Stübner, Bjorn Andersson, Andy Gross,
open list:GPIO SUBSYSTEM, Linux ARM,
open list:ARM/Rockchip SoC...,
linux-kernel
On Fri, Jul 26, 2019 at 1:28 PM Anders Roxell <anders.roxell@linaro.org> wrote:
> 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")
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-05 10:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 11:28 [PATCH 1/2] pinctrl: rockchip: Mark expected switch fall-through Anders Roxell
2019-08-05 10:32 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).