clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
Subsystems (3)
PATCH 1/1 clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
best_rate is reported as potentially uninitialized by gcc.
--- drivers/clk/bcm/clk-bcm2835.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/bcm/clk-bcm2835.c +1 -1
@@ -1029,7 +1029,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw,struct bcm2835_clock *clock =bcm2835_clock_from_hw (hw);struct bcm2835_cprman *cprman = clock->cprman;const struct bcm2835_clock_data *data = clock->data; -unsigned long best_rate; +unsigned long best_rate =0 ;u32 curdiv, mindiv, maxdiv;struct clk_hw *parent;
Signature · 1 line
2.7.4
PATCH 1/1 clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
Quoted 5 lines · CET Boris Brezillon
best_rateis reported as potentially uninitialized by gcc.Signed-off-by Boris Brezillon <[email protected]>Fixes 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")Reported-by Stephen Rothwell <[email protected]>
I wonder why I didn't get that. Which compiler version did you use?
Arnd
PATCH 1/1 clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
Hi Arnd,
Quoted 9 lines · On Mon, 12 Dec 2016 09:12:36 +0100 Arnd Bergmann <[email protected]> wrote:
Quoted 5 lines · CET Boris Brezillon
best_rateis reported as potentially uninitialized by gcc.Signed-off-by Boris Brezillon <[email protected]>Fixes 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")Reported-by Stephen Rothwell <[email protected]>I wonder why I didn't get that. Which compiler version did you use?
Gcc-5.2.0 powerpc-le hosted cross compiler.
Signature · 2 lines
Cheers, Stephen Rothwell
PATCH 1/1 clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
In reply to Arnd BergmannQuoted 9 lines · On Mon, 12 Dec 2016 09:12:36 +0100 Arnd Bergmann <[email protected]> wrote:
Quoted 5 lines · CET Boris Brezillon
best_rateis reported as potentially uninitialized by gcc.Signed-off-by Boris Brezillon <[email protected]>Fixes 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")Reported-by Stephen Rothwell <[email protected]>I wonder why I didn't get that. Which compiler version did you use?
In case you're interested, my gcc [1] failed to detect it as well, and this is not the first time it happens :-/.
[1]gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
PATCH 1/1 clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
Quoted 10 lines · CET Boris Brezillon
Quoted 7 lines · On Mon, 12 Dec 2016 09:12:36 +0100 Arnd Bergmann <[email protected]> wrote:
Quoted 5 lines · CET Boris Brezillon
best_rateis reported as potentially uninitialized by gcc.Signed-off-by Boris Brezillon <[email protected]>Fixes 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")Reported-by Stephen Rothwell <[email protected]>
Quoted 7 lines
Quoted 2 lines
I wonder why I didn't get that. Which compiler version did you use?
In case you're interested, my gcc [1] failed to detect it as well, and this is not the first time it happens :-/.
[1]gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
No, I see it now with gcc-7, it only just turned up in linux-next.
I ran into it right away with an allmodconfig build. You were probably testing based on an earlier v4.9-rc release that had the warning globally disabled.
Arnd
PATCH 1/1 clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
Quoted 17 lines · On Mon, 12 Dec 2016 09:34:28 +0100 Arnd Bergmann <[email protected]> wrote:
Quoted 16 lines · CET Boris Brezillon
Quoted 9 lines · On Mon, 12 Dec 2016 09:12:36 +0100 Arnd Bergmann <[email protected]> wrote:
Quoted 5 lines · CET Boris Brezillon
best_rateis reported as potentially uninitialized by gcc.Signed-off-by Boris Brezillon <[email protected]>Fixes 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")Reported-by Stephen Rothwell <[email protected]>I wonder why I didn't get that. Which compiler version did you use?
In case you're interested, my gcc [1] failed to detect it as well, and this is not the first time it happens :-/.
Quoted 7 lines
Quoted 1 line
[1]gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
No, I see it now with gcc-7, it only just turned up in linux-next.
I ran into it right away with an allmodconfig build. You were probably testing based on an earlier v4.9-rc release that had the warning globally disabled.
Indeed, I was testing on a 4.9-rc.
PATCH 1/1 clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
In reply to Boris BrezillonQuoted 5 lines · Boris Brezillon
best_rateis reported as potentially uninitialized by gcc.Signed-off-by Boris Brezillon <[email protected]>Fixes 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")Reported-by Stephen Rothwell <[email protected]>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161212/65cadde3/attachment.sig>
Stephen Boyd
AppliedPATCH 1/1 clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
In reply to Boris BrezillonQuoted 6 lines · Boris Brezillon
best_rateis reported as potentially uninitialized by gcc.Signed-off-by Boris Brezillon <[email protected]>Fixes 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")Reported-by Stephen Rothwell <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project