[PATCH 1/2] clk: k3: pll: initialize success flag in ti_pll_wait_for_lock

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Aug 31 07:44:18 PDT 2026


When built with clang, we run into following warning (turned error with
CONFIG_WERROR):

  drivers/clk/k3/pll.c:100:14: error: variable 'success' is used uninitialized
  whenever 'for' loop exits because its condition is false [-Werror,-Wsometimes-uninitialized]

Initialize the variable to fix.

Fixes: 657d39593b2f ("clk: add K3 clk driver")
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/clk/k3/pll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/k3/pll.c b/drivers/clk/k3/pll.c
index c76a91b1d094..ef59da3d9dbc 100644
--- a/drivers/clk/k3/pll.c
+++ b/drivers/clk/k3/pll.c
@@ -95,7 +95,7 @@ static int ti_pll_wait_for_lock(struct ti_pll_clk *pll)
 	int i;
 	u32 pllfm;
 	u32 pll_type;
-	int success;
+	int success = 0;
 
 	for (i = 0; i < 100000; i++) {
 		stat = readl(pll->reg + PLL_16FFT_STAT);
-- 
2.47.3




More information about the barebox mailing list