* [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
@ 2016-12-12 8:00 Boris Brezillon
2016-12-12 8:12 ` Arnd Bergmann
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Boris Brezillon @ 2016-12-12 8:00 UTC (permalink / raw)
To: linux-arm-kernel
best_rate is reported as potentially uninitialized by gcc.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/clk/bcm/clk-bcm2835.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index eaf82f49dede..0d14409097e7 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -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;
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
2016-12-12 8:00 [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() Boris Brezillon
@ 2016-12-12 8:12 ` Arnd Bergmann
2016-12-12 8:22 ` Stephen Rothwell
2016-12-12 8:31 ` Boris Brezillon
2016-12-12 17:24 ` Eric Anholt
2016-12-12 19:26 ` Stephen Boyd
2 siblings, 2 replies; 8+ messages in thread
From: Arnd Bergmann @ 2016-12-12 8:12 UTC (permalink / raw)
To: linux-arm-kernel
On Monday, December 12, 2016 9:00:53 AM CET Boris Brezillon wrote:
> best_rate is reported as potentially uninitialized by gcc.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
I wonder why I didn't get that. Which compiler version did you use?
Arnd
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
2016-12-12 8:12 ` Arnd Bergmann
@ 2016-12-12 8:22 ` Stephen Rothwell
2016-12-12 8:31 ` Boris Brezillon
1 sibling, 0 replies; 8+ messages in thread
From: Stephen Rothwell @ 2016-12-12 8:22 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
On Mon, 12 Dec 2016 09:12:36 +0100 Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Monday, December 12, 2016 9:00:53 AM CET Boris Brezillon wrote:
> > best_rate is reported as potentially uninitialized by gcc.
> >
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
>
> I wonder why I didn't get that. Which compiler version did you use?
Gcc-5.2.0 powerpc-le hosted cross compiler.
--
Cheers,
Stephen Rothwell
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
2016-12-12 8:12 ` Arnd Bergmann
2016-12-12 8:22 ` Stephen Rothwell
@ 2016-12-12 8:31 ` Boris Brezillon
2016-12-12 8:34 ` Arnd Bergmann
1 sibling, 1 reply; 8+ messages in thread
From: Boris Brezillon @ 2016-12-12 8:31 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 12 Dec 2016 09:12:36 +0100
Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday, December 12, 2016 9:00:53 AM CET Boris Brezillon wrote:
> > best_rate is reported as potentially uninitialized by gcc.
> >
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
>
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
2016-12-12 8:31 ` Boris Brezillon
@ 2016-12-12 8:34 ` Arnd Bergmann
2016-12-12 9:03 ` Boris Brezillon
0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2016-12-12 8:34 UTC (permalink / raw)
To: linux-arm-kernel
On Monday, December 12, 2016 9:31:30 AM CET Boris Brezillon wrote:
> On Mon, 12 Dec 2016 09:12:36 +0100
> Arnd Bergmann <arnd@arndb.de> wrote:
>
> > On Monday, December 12, 2016 9:00:53 AM CET Boris Brezillon wrote:
> > > best_rate is reported as potentially uninitialized by gcc.
> > >
> > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
> > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> >
> > 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
2016-12-12 8:34 ` Arnd Bergmann
@ 2016-12-12 9:03 ` Boris Brezillon
0 siblings, 0 replies; 8+ messages in thread
From: Boris Brezillon @ 2016-12-12 9:03 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 12 Dec 2016 09:34:28 +0100
Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday, December 12, 2016 9:31:30 AM CET Boris Brezillon wrote:
> > On Mon, 12 Dec 2016 09:12:36 +0100
> > Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > > On Monday, December 12, 2016 9:00:53 AM CET Boris Brezillon wrote:
> > > > best_rate is reported as potentially uninitialized by gcc.
> > > >
> > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
> > > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > >
> > > 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.
Indeed, I was testing on a 4.9-rc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
2016-12-12 8:00 [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() Boris Brezillon
2016-12-12 8:12 ` Arnd Bergmann
@ 2016-12-12 17:24 ` Eric Anholt
2016-12-12 19:26 ` Stephen Boyd
2 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2016-12-12 17:24 UTC (permalink / raw)
To: linux-arm-kernel
Boris Brezillon <boris.brezillon@free-electrons.com> writes:
> best_rate is reported as potentially uninitialized by gcc.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: Eric Anholt <eric@anholt.net>
-------------- 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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
2016-12-12 8:00 [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() Boris Brezillon
2016-12-12 8:12 ` Arnd Bergmann
2016-12-12 17:24 ` Eric Anholt
@ 2016-12-12 19:26 ` Stephen Boyd
2 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2016-12-12 19:26 UTC (permalink / raw)
To: linux-arm-kernel
On 12/12, Boris Brezillon wrote:
> best_rate is reported as potentially uninitialized by gcc.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
Applied to clk-next
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-12-12 19:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12 8:00 [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() Boris Brezillon
2016-12-12 8:12 ` Arnd Bergmann
2016-12-12 8:22 ` Stephen Rothwell
2016-12-12 8:31 ` Boris Brezillon
2016-12-12 8:34 ` Arnd Bergmann
2016-12-12 9:03 ` Boris Brezillon
2016-12-12 17:24 ` Eric Anholt
2016-12-12 19:26 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).