linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Alexey Firago <alexey_firago@mentor.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] clk: vc5: Initialize src in vc5_mux_set_parent()
Date: Sun, 16 Dec 2018 09:20:44 +0200	[thread overview]
Message-ID: <2374057.Z2vKcv2BoK@avalon> (raw)
In-Reply-To: <20181214214959.162744-1-sboyd@kernel.org>

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




      parent reply	other threads:[~2018-12-16  7:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 21:49 [PATCH] clk: vc5: Initialize src in vc5_mux_set_parent() Stephen Boyd
2018-12-14 22:29 ` Marek Vasut
2018-12-16  7:20 ` Laurent Pinchart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2374057.Z2vKcv2BoK@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=alexey_firago@mentor.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).