mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] clk: mediatek: fix cppcheck error for uninitialized variable
       [not found] <20231225152806.3716898-1-user@falcon>
@ 2024-01-02  9:41 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; only message in thread
From: AngeloGioacchino Del Regno @ 2024-01-02  9:41 UTC (permalink / raw)
  To: mturquette, sboyd, matthias.bgg, kishan.dudhatra
  Cc: Chen-Yu Tsai, Tom Rix, linux-clk, linux-kernel, linux-arm-kernel,
	linux-mediatek

Il 25/12/23 16:28,  ha scritto:
> From: Kishan Dudhatra <kishan.dudhatra@siliconsignals.io>
> 
> cppcheck reports below warning
> 
> clk/mediatek/clk-fhctl.c:206:27:
> error: Uninitialized variable: pll_postdiv [uninitvar]
> if (postdiv && postdiv < pll_postdiv)
> 
> This is due to uninitialization of variable pll_postdiv,
> which is now initialized as part of this patch.
> 
> Signed-off-by: Kishan Dudhatra <kishan.dudhatra@siliconsignals.io>

This is a false positive... the pll_postdiv variable is *always* used
and *only if* postdiv > 0.

P.S.: There was some problem with your email, as the From entry is empty.

Regards,
Angelo

> 
> diff --git a/drivers/clk/mediatek/clk-fhctl.c b/drivers/clk/mediatek/clk-fhctl.c
> index 33b6ad8fdc2e..b0e71e4fd938 100644
> --- a/drivers/clk/mediatek/clk-fhctl.c
> +++ b/drivers/clk/mediatek/clk-fhctl.c
> @@ -186,7 +186,7 @@ static int fhctl_hopping(struct mtk_fh *fh, unsigned int new_dds,
>   	struct fh_pll_regs *regs = &fh->regs;
>   	struct mtk_clk_pll *pll = &fh->clk_pll;
>   	spinlock_t *lock = fh->lock;
> -	unsigned int pll_postdiv;
> +	unsigned int pll_postdiv = 0;
>   	unsigned long flags = 0;
>   	int ret;
>   



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-02  9:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20231225152806.3716898-1-user@falcon>
2024-01-02  9:41 ` [PATCH] clk: mediatek: fix cppcheck error for uninitialized variable AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®