Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406431 > unrolled thread

[PATCH 2/2] clk/vt8500: Fix compilation warnings

Started byRoman Volkov <v1ron@mail.ru>
First post2016-05-24 22:20 +0200
Last post2016-05-24 22:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] clk/vt8500: Fix compilation warnings Roman Volkov <v1ron@mail.ru> - 2016-05-24 22:20 +0200

#1406431 — [PATCH 2/2] clk/vt8500: Fix compilation warnings

FromRoman Volkov <v1ron@mail.ru>
Date2016-05-24 22:20 +0200
Subject[PATCH 2/2] clk/vt8500: Fix compilation warnings
Message-ID<rCqY2-7Zt-19@gated-at.bofh.it>
From: Roman Volkov <rvolkov@v1ros.org>

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 <rvolkov@v1ros.org>
---
 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web