From: Stephen Boyd <sboyd@codeaurora.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrzej Hajda <a.hajda@samsung.com>,
linux-arm-kernel@lists.infradead.org,
Tony Prisk <linux@prisktech.co.nz>, Roman Volkov <v1ron@mail.ru>
Subject: Re: [PATCH] clk: vt8500: don't return possibly uninitialized data
Date: Mon, 1 Feb 2016 17:15:45 -0800 [thread overview]
Message-ID: <20160202011545.GG4848@codeaurora.org> (raw)
In-Reply-To: <4790407.6zgSQCdsSB@wuerfel>
On 02/01, Arnd Bergmann wrote:
> The clk-vt8500.c driver would previously enter an endless loop
> when invalid settings got requested, this was now fixed. However,
> the driver will now return uninitialized data for a subset of those
> cases instead, as the gcc correctly warns:
>
> clk/clk-vt8500.c: In function 'wm8650_find_pll_bits':
> clk/clk-vt8500.c:423:12: error: 'best_div2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> *divisor2 = best_div2;
> ^
> clk/clk-vt8500.c:422:12: error: 'best_div1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> *divisor1 = best_div1;
> ^
> clk/clk-vt8500.c:421:14: error: 'best_mul' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> *multiplier = best_mul;
>
> This reworks the error handling in the driver so we now return
> -EINVAL from clk_round_rate() and clk_set_rate() when we get
> impossible inputs.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 090341b0a95d ("clk: vt8500: fix sign of possible PLL values")
My compiler still gets warnings even after this patch is applied.
drivers/clk/clk-vt8500.c: In function ‘wm8750_find_pll_bits’:
drivers/clk/clk-vt8500.c:509:12: warning: ‘best_div2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:508:12: warning: ‘best_div1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:507:14: warning: ‘best_mul’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c: In function ‘wm8650_find_pll_bits’:
drivers/clk/clk-vt8500.c:430:12: warning: ‘best_div2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:429:12: warning: ‘best_div1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:428:14: warning: ‘best_mul’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c: In function ‘wm8850_find_pll_bits’:
drivers/clk/clk-vt8500.c:560:12: warning: ‘best_div2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:559:12: warning: ‘best_div1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:558:14: warning: ‘best_mul’ may be used uninitialized in this function [-Wmaybe-uninitialized]
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: vt8500: don't return possibly uninitialized data
Date: Mon, 1 Feb 2016 17:15:45 -0800 [thread overview]
Message-ID: <20160202011545.GG4848@codeaurora.org> (raw)
In-Reply-To: <4790407.6zgSQCdsSB@wuerfel>
On 02/01, Arnd Bergmann wrote:
> The clk-vt8500.c driver would previously enter an endless loop
> when invalid settings got requested, this was now fixed. However,
> the driver will now return uninitialized data for a subset of those
> cases instead, as the gcc correctly warns:
>
> clk/clk-vt8500.c: In function 'wm8650_find_pll_bits':
> clk/clk-vt8500.c:423:12: error: 'best_div2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> *divisor2 = best_div2;
> ^
> clk/clk-vt8500.c:422:12: error: 'best_div1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> *divisor1 = best_div1;
> ^
> clk/clk-vt8500.c:421:14: error: 'best_mul' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> *multiplier = best_mul;
>
> This reworks the error handling in the driver so we now return
> -EINVAL from clk_round_rate() and clk_set_rate() when we get
> impossible inputs.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 090341b0a95d ("clk: vt8500: fix sign of possible PLL values")
My compiler still gets warnings even after this patch is applied.
drivers/clk/clk-vt8500.c: In function ?wm8750_find_pll_bits?:
drivers/clk/clk-vt8500.c:509:12: warning: ?best_div2? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:508:12: warning: ?best_div1? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:507:14: warning: ?best_mul? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c: In function ?wm8650_find_pll_bits?:
drivers/clk/clk-vt8500.c:430:12: warning: ?best_div2? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:429:12: warning: ?best_div1? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:428:14: warning: ?best_mul? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c: In function ?wm8850_find_pll_bits?:
drivers/clk/clk-vt8500.c:560:12: warning: ?best_div2? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:559:12: warning: ?best_div1? may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/clk/clk-vt8500.c:558:14: warning: ?best_mul? may be used uninitialized in this function [-Wmaybe-uninitialized]
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2016-02-02 1:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-01 10:19 [PATCH] clk: vt8500: don't return possibly uninitialized data Arnd Bergmann
2016-02-01 10:19 ` Arnd Bergmann
2016-02-02 1:15 ` Stephen Boyd [this message]
2016-02-02 1:15 ` Stephen Boyd
2016-02-02 12:49 ` Arnd Bergmann
2016-02-02 12:49 ` Arnd Bergmann
2016-02-02 12:49 ` Arnd Bergmann
2016-02-02 19:47 ` Stephen Boyd
2016-02-02 19:47 ` Stephen Boyd
2016-02-02 20:00 ` Arnd Bergmann
2016-02-02 20:00 ` Arnd Bergmann
2016-02-03 8:36 ` Roman Volkov
2016-02-03 8:36 ` Roman Volkov
2016-02-03 8:36 ` Roman Volkov
2016-02-03 9:15 ` Arnd Bergmann
2016-02-03 9:15 ` Arnd Bergmann
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=20160202011545.GG4848@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=a.hajda@samsung.com \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=mturquette@baylibre.com \
--cc=v1ron@mail.ru \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.