* [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs
@ 2019-07-28 23:56 Gustavo A. R. Silva
2019-07-29 16:35 ` Kees Cook
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-28 23:56 UTC (permalink / raw)
To: Linus Walleij, Lee Jones
Cc: linux-arm-kernel, linux-kernel, Gustavo A. R. Silva,
Stephen Rothwell, Kees Cook
Mark switch cases where we are expecting to fall through.
This patch fixes the following warnings:
drivers/mfd/db8500-prcmu.c: In function 'dsiclk_rate':
drivers/mfd/db8500-prcmu.c:1592:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
div *= 2;
~~~~^~~~
drivers/mfd/db8500-prcmu.c:1593:2: note: here
case PRCM_DSI_PLLOUT_SEL_PHI_2:
^~~~
drivers/mfd/db8500-prcmu.c:1594:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
div *= 2;
~~~~^~~~
drivers/mfd/db8500-prcmu.c:1595:2: note: here
case PRCM_DSI_PLLOUT_SEL_PHI:
^~~~
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/mfd/db8500-prcmu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 3f21e26b8d36..90e0f21bc49c 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -1590,8 +1590,10 @@ static unsigned long dsiclk_rate(u8 n)
switch (divsel) {
case PRCM_DSI_PLLOUT_SEL_PHI_4:
div *= 2;
+ /* Fall through */
case PRCM_DSI_PLLOUT_SEL_PHI_2:
div *= 2;
+ /* Fall through */
case PRCM_DSI_PLLOUT_SEL_PHI:
return pll_rate(PRCM_PLLDSI_FREQ, clock_rate(PRCMU_HDMICLK),
PLL_RAW) / div;
--
2.22.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs
2019-07-28 23:56 [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-07-29 16:35 ` Kees Cook
2019-08-07 13:12 ` Linus Walleij
2019-08-12 10:30 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2019-07-29 16:35 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Linus Walleij, Lee Jones, linux-arm-kernel, linux-kernel,
Stephen Rothwell
On Sun, Jul 28, 2019 at 06:56:14PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/mfd/db8500-prcmu.c: In function 'dsiclk_rate':
> drivers/mfd/db8500-prcmu.c:1592:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> div *= 2;
> ~~~~^~~~
> drivers/mfd/db8500-prcmu.c:1593:2: note: here
> case PRCM_DSI_PLLOUT_SEL_PHI_2:
> ^~~~
> drivers/mfd/db8500-prcmu.c:1594:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> div *= 2;
> ~~~~^~~~
> drivers/mfd/db8500-prcmu.c:1595:2: note: here
> case PRCM_DSI_PLLOUT_SEL_PHI:
> ^~~~
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> drivers/mfd/db8500-prcmu.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index 3f21e26b8d36..90e0f21bc49c 100644
> --- a/drivers/mfd/db8500-prcmu.c
> +++ b/drivers/mfd/db8500-prcmu.c
> @@ -1590,8 +1590,10 @@ static unsigned long dsiclk_rate(u8 n)
> switch (divsel) {
> case PRCM_DSI_PLLOUT_SEL_PHI_4:
> div *= 2;
> + /* Fall through */
> case PRCM_DSI_PLLOUT_SEL_PHI_2:
> div *= 2;
> + /* Fall through */
> case PRCM_DSI_PLLOUT_SEL_PHI:
> return pll_rate(PRCM_PLLDSI_FREQ, clock_rate(PRCMU_HDMICLK),
> PLL_RAW) / div;
> --
> 2.22.0
>
--
Kees Cook
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs
2019-07-28 23:56 [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-29 16:35 ` Kees Cook
@ 2019-08-07 13:12 ` Linus Walleij
2019-08-12 10:30 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2019-08-07 13:12 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Lee Jones, Linux ARM, linux-kernel, Stephen Rothwell, Kees Cook
On Mon, Jul 29, 2019 at 1:56 AM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/mfd/db8500-prcmu.c: In function 'dsiclk_rate':
> drivers/mfd/db8500-prcmu.c:1592:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> div *= 2;
> ~~~~^~~~
> drivers/mfd/db8500-prcmu.c:1593:2: note: here
> case PRCM_DSI_PLLOUT_SEL_PHI_2:
> ^~~~
> drivers/mfd/db8500-prcmu.c:1594:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> div *= 2;
> ~~~~^~~~
> drivers/mfd/db8500-prcmu.c:1595:2: note: here
> case PRCM_DSI_PLLOUT_SEL_PHI:
> ^~~~
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs
2019-07-28 23:56 [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-29 16:35 ` Kees Cook
2019-08-07 13:12 ` Linus Walleij
@ 2019-08-12 10:30 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2019-08-12 10:30 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Linus Walleij, linux-arm-kernel, linux-kernel, Stephen Rothwell,
Kees Cook
On Sun, 28 Jul 2019, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/mfd/db8500-prcmu.c: In function 'dsiclk_rate':
> drivers/mfd/db8500-prcmu.c:1592:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> div *= 2;
> ~~~~^~~~
> drivers/mfd/db8500-prcmu.c:1593:2: note: here
> case PRCM_DSI_PLLOUT_SEL_PHI_2:
> ^~~~
> drivers/mfd/db8500-prcmu.c:1594:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> div *= 2;
> ~~~~^~~~
> drivers/mfd/db8500-prcmu.c:1595:2: note: here
> case PRCM_DSI_PLLOUT_SEL_PHI:
> ^~~~
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> drivers/mfd/db8500-prcmu.c | 2 ++
> 1 file changed, 2 insertions(+)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-08-12 10:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-28 23:56 [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-29 16:35 ` Kees Cook
2019-08-07 13:12 ` Linus Walleij
2019-08-12 10:30 ` Lee Jones
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).