linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: sophgo: clk-sg2042-pll: Fix uninitialized variable in debug output
@ 2024-07-18  2:25 Dan Carpenter
  2024-07-18  8:48 ` Chen Wang
  2024-07-18 20:33 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-07-18  2:25 UTC (permalink / raw)
  To: Chen Wang
  Cc: Michael Turquette, Stephen Boyd, Inochi Amaoto, linux-clk,
	linux-kernel, kernel-janitors

If sg2042_get_pll_ctl_setting() fails then "value" isn't initialized and
it is printed in the debug output.  Initialize it to zero.

Fixes: 48cf7e01386e ("clk: sophgo: Add SG2042 clock driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/clk/sophgo/clk-sg2042-pll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sophgo/clk-sg2042-pll.c b/drivers/clk/sophgo/clk-sg2042-pll.c
index aa142897aa5e..24b0eab6154b 100644
--- a/drivers/clk/sophgo/clk-sg2042-pll.c
+++ b/drivers/clk/sophgo/clk-sg2042-pll.c
@@ -387,7 +387,7 @@ static int sg2042_clk_pll_set_rate(struct clk_hw *hw,
 	struct sg2042_pll_clock *pll = to_sg2042_pll_clk(hw);
 	struct sg2042_pll_ctrl pctrl_table;
 	unsigned long flags;
-	u32 value;
+	u32 value = 0;
 	int ret;
 
 	spin_lock_irqsave(pll->lock, flags);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: sophgo: clk-sg2042-pll: Fix uninitialized variable in debug output
  2024-07-18  2:25 [PATCH] clk: sophgo: clk-sg2042-pll: Fix uninitialized variable in debug output Dan Carpenter
@ 2024-07-18  8:48 ` Chen Wang
  2024-07-18 20:33 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Chen Wang @ 2024-07-18  8:48 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Michael Turquette, Stephen Boyd, Inochi Amaoto, linux-clk,
	linux-kernel, kernel-janitors


On 2024/7/18 10:25, Dan Carpenter wrote:
> If sg2042_get_pll_ctl_setting() fails then "value" isn't initialized and
> it is printed in the debug output.  Initialize it to zero.
>
> Fixes: 48cf7e01386e ("clk: sophgo: Add SG2042 clock driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   drivers/clk/sophgo/clk-sg2042-pll.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/sophgo/clk-sg2042-pll.c b/drivers/clk/sophgo/clk-sg2042-pll.c
> index aa142897aa5e..24b0eab6154b 100644
> --- a/drivers/clk/sophgo/clk-sg2042-pll.c
> +++ b/drivers/clk/sophgo/clk-sg2042-pll.c
> @@ -387,7 +387,7 @@ static int sg2042_clk_pll_set_rate(struct clk_hw *hw,
>   	struct sg2042_pll_clock *pll = to_sg2042_pll_clk(hw);
>   	struct sg2042_pll_ctrl pctrl_table;
>   	unsigned long flags;
> -	u32 value;
> +	u32 value = 0;
>   	int ret;
>   
>   	spin_lock_irqsave(pll->lock, flags);

Reviewed-by: Chen Wang <unicorn_wang@outlook.com>

Thank you Dan.

Regards,

Chen


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: sophgo: clk-sg2042-pll: Fix uninitialized variable in debug output
  2024-07-18  2:25 [PATCH] clk: sophgo: clk-sg2042-pll: Fix uninitialized variable in debug output Dan Carpenter
  2024-07-18  8:48 ` Chen Wang
@ 2024-07-18 20:33 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2024-07-18 20:33 UTC (permalink / raw)
  To: Chen Wang, Dan Carpenter
  Cc: Michael Turquette, Inochi Amaoto, linux-clk, linux-kernel,
	kernel-janitors

Quoting Dan Carpenter (2024-07-17 19:25:53)
> If sg2042_get_pll_ctl_setting() fails then "value" isn't initialized and
> it is printed in the debug output.  Initialize it to zero.
> 
> Fixes: 48cf7e01386e ("clk: sophgo: Add SG2042 clock driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-18 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-18  2:25 [PATCH] clk: sophgo: clk-sg2042-pll: Fix uninitialized variable in debug output Dan Carpenter
2024-07-18  8:48 ` Chen Wang
2024-07-18 20:33 ` Stephen Boyd

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).