From: Roman Volkov <[email protected]>

GCC 5.3.0 still throws the following warnings for functions
wm8750_find_pll_bits() and wm8850_find_pll_bits():

warning: 'best_div2' may be used uninitialized in this function
warning: 'best_div1' may be used uninitialized in this function
warning: 'best_mul' may be used uninitialized in this function

These warnings are false positives, the variables are controlled
by checking the value of the variable 'best_err' which is -1 by
default. It is safe to initialize all these variables to zero.

Fixes: 090341b0a95d ("clk: vt8500: fix sign of possible PLL values")
Signed-off-by: Roman Volkov <[email protected]>
---
 drivers/clk/clk-vt8500.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c
index 77650f19a9b6..7c970d7c0a6a 100644
--- a/drivers/clk/clk-vt8500.c
+++ b/drivers/clk/clk-vt8500.c
@@ -461,7 +461,7 @@ static int wm8750_find_pll_bits(unsigned long rate, 
unsigned long parent_rate,
 {
        u32 mul;
        int div1, div2;
-       u32 best_mul, best_div1, best_div2;
+       u32 best_mul = 0, best_div1 = 0, best_div2 = 0;
        unsigned long tclk, rate_err, best_err;
 
        best_err = (unsigned long)-1;
@@ -513,7 +513,7 @@ static int wm8850_find_pll_bits(unsigned long rate, 
unsigned long parent_rate,
 {
        u32 mul;
        int div1, div2;
-       u32 best_mul, best_div1, best_div2;
+       u32 best_mul = 0, best_div1 = 0, best_div2 = 0;
        unsigned long tclk, rate_err, best_err;
 
        best_err = (unsigned long)-1;
-- 
2.8.0

Reply via email to