Skip to contentSkip to conversation

clk: st: avoid build warnings

PATCH New Arnd Bergmann 2 participants 2 messages Jun 4, 2014 – Jun 5, 2014 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: st: avoid build warnings

This driver prints some variables in debugging output when their contents are undefined.

drivers/clk/st/clkgen-fsyn.c: In function 'quadfs_pll_fs660c32_round_rate':
drivers/clk/st/clkgen-fsyn.c:419:93: warning: 'params.sdiv' may be used uninitialized in this function [-Wmaybe-uninitialized]
pr_debug("%s: %s new rate %ld [sdiv=0x%x,md=0x%x,pe=0x%x,nsdiv3=%u]\n",

                                                                                             ^
drivers/clk/st/clkgen-fsyn.c:414:16: note: 'params.sdiv' was declared here
  struct stm_fs params;
                ^

This removes them from the output.

drivers/clk/st/clkgen-fsyn.c +2 -9
index 4f53ee0..1d2ecfe 100644
@@ -416,12 +416,6 @@ static long quadfs_pll_fs660c32_round_rate(struct clk_hw *hw, unsigned long rate
 	if (!clk_fs660c32_vco_get_params(*prate, rate, &params))
 		clk_fs660c32_vco_get_rate(*prate, &params, &rate);
 
-	pr_debug("%s: %s new rate %ld [sdiv=0x%x,md=0x%x,pe=0x%x,nsdiv3=%u]\n",
-		 __func__, __clk_get_name(hw->clk),
-		 rate, (unsigned int)params.sdiv,
-		 (unsigned int)params.mdiv,
-		 (unsigned int)params.pe, (unsigned int)params.nsdiv);
-
 	return rate;
 }
 
@@ -439,9 +433,8 @@ static int quadfs_pll_fs660c32_set_rate(struct clk_hw *hw, unsigned long rate,
 	if (!clk_fs660c32_vco_get_params(parent_rate, rate, &params))
 		clk_fs660c32_vco_get_rate(parent_rate, &params, &hwrate);
 
-	pr_debug("%s: %s new rate %ld [ndiv=0x%x]\n",
-		 __func__, __clk_get_name(hw->clk),
-		 hwrate, (unsigned int)params.ndiv);
+	pr_debug("%s: %s new rate %ld\n",
+		 __func__, __clk_get_name(hw->clk), hwrate);
 
 	if (!hwrate)
 		return -EINVAL;
#1 lore raw

PATCH 1/1 clk: st: avoid build warnings

Hi Arnd,

Quoted 6 lines · Arnd Bergmann

This driver prints some variables in debugging output when their contents are undefined.

drivers/clk/st/clkgen-fsyn.c: In function 'quadfs_pll_fs660c32_round_rate':
drivers/clk/st/clkgen-fsyn.c:419:93: warning: 'params.sdiv' may be used uninitialized in this function [-Wmaybe-uninitialized]
pr_debug("%s: %s new rate %ld [sdiv=0x%x,md=0x%x,pe=0x%x,nsdiv3=%u]\n",

Quoted 9 lines
                                                                                              ^
drivers/clk/st/clkgen-fsyn.c:414:16: note: 'params.sdiv' was declared here
   struct stm_fs params;
                 ^

This removes them from the output.

You can add my:

Thanks!
Maxime