[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201907290935.B02CE809F@keescook>
Date: Mon, 29 Jul 2019 09:35:13 -0700
From: Kees Cook <keescook@...omium.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Lee Jones <lee.jones@...aro.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH] mfd: db8500-prcmu: Mark expected switch fall-throughs
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@...b.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
Reviewed-by: Kees Cook <keescook@...omium.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
Powered by blists - more mailing lists