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 <[email protected]>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>

Reviewed-by: Kees Cook <[email protected]>

-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

Reply via email to