public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] clk: mediatek: fix cppcheck error for uninitialized variable
@ 2023-12-25 15:28 
  2024-01-02  9:41 ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 2+ messages in thread
From:  @ 2023-12-25 15:28 UTC (permalink / raw)
  To: mturquette, sboyd, matthias.bgg, angelogioacchino.delregno
  Cc: kishan.dudhatra, Chen-Yu Tsai, Tom Rix, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek

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>

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;
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-01-02  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-25 15:28 [PATCH] clk: mediatek: fix cppcheck error for uninitialized variable 
2024-01-02  9:41 ` 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