From: Roman Volkov <v1ron@mail.ru>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Stephen Boyd <sboyd@codeaurora.org>,
Michael Turquette <mturquette@baylibre.com>,
Roman Volkov <rvolkov@v1ros.org>,
Tony Prisk <linux@prisktech.co.nz>
Subject: [PATCH 2/2] clk/vt8500: Fix compilation warnings
Date: Tue, 24 May 2016 23:07:53 +0300 [thread overview]
Message-ID: <1464120473-1808-3-git-send-email-v1ron@mail.ru> (raw)
In-Reply-To: <1464120473-1808-1-git-send-email-v1ron@mail.ru>
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
next prev parent reply other threads:[~2016-05-24 20:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 20:07 [PATCH 0/2] Rework clk/vt8500 wm8650_find_pll_bits() Roman Volkov
2016-05-24 20:07 ` [PATCH 1/2] clk/vt8500: Rework wm8650_find_pll_bits() Roman Volkov
2016-05-24 20:07 ` Roman Volkov [this message]
2016-05-31 10:51 ` [PATCH 2/2] clk/vt8500: Fix compilation warnings Arnd Bergmann
2016-05-31 18:38 ` Roman Volkov
2016-05-31 20:15 ` Arnd Bergmann
2016-06-01 22:07 ` Stephen Boyd
2016-05-31 6:23 ` [PATCH 0/2] Rework clk/vt8500 wm8650_find_pll_bits() Roman Volkov
2016-06-01 22:06 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464120473-1808-3-git-send-email-v1ron@mail.ru \
--to=v1ron@mail.ru \
--cc=arnd@arndb.de \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=mturquette@baylibre.com \
--cc=rvolkov@v1ros.org \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®