lkml.org 
[lkml]   [2018]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] clk: vc5: Initialize src in vc5_mux_set_parent()
Date
Hi Stephen,

On Friday, 14 December 2018 23:49:59 EET Stephen Boyd wrote:
> It seems that it may be possible to get to the regmap update call
> without ever initializing this variable, so just set it to 0 to be safe.

This can't happen as the probe() function would have failed first. I'd thus
add a comment to explain that the goal is only to silence a compiler warning.

> Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Alexey Firago <alexey_firago@mentor.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: linux-renesas-soc@vger.kernel.org
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---
> drivers/clk/clk-versaclock5.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c
> index 5b393e711e94..026f76276933 100644
> --- a/drivers/clk/clk-versaclock5.c
> +++ b/drivers/clk/clk-versaclock5.c
> @@ -246,7 +246,7 @@ static int vc5_mux_set_parent(struct clk_hw *hw, u8
> index) struct vc5_driver_data *vc5 =
> container_of(hw, struct vc5_driver_data, clk_mux);
> const u8 mask = VC5_PRIM_SRC_SHDN_EN_XTAL | VC5_PRIM_SRC_SHDN_EN_CLKIN;
> - u8 src;
> + u8 src = 0;
>
> if ((index > 1) || !vc5->clk_mux_ins)
> return -EINVAL;


--
Regards,

Laurent Pinchart



\
 
 \ /
  Last update: 2018-12-16 08:21    [W:0.048 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site