a40245b8eb93b1ac7252500e834fa89477a2c8f4
[openwrt/staging/chunkeey.git] /
1 From 9db88c2a81a12eb2b2953ee1f9090624fcc47dab Mon Sep 17 00:00:00 2001
2 From: Boris Brezillon <boris.brezillon@free-electrons.com>
3 Date: Mon, 12 Dec 2016 09:00:53 +0100
4 Subject: [PATCH] clk: bcm: Fix 'maybe-uninitialized' warning in
5 bcm2835_clock_choose_div_and_prate()
6
7 best_rate is reported as potentially uninitialized by gcc.
8
9 Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
10 Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
11 Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
12 Reviewed-by: Eric Anholt <eric@anholt.net>
13 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
14 (cherry picked from commit 2aab7a2055a1705c9e30920d95a596226999eb21)
15 ---
16 drivers/clk/bcm/clk-bcm2835.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19 --- a/drivers/clk/bcm/clk-bcm2835.c
20 +++ b/drivers/clk/bcm/clk-bcm2835.c
21 @@ -1035,7 +1035,7 @@ static unsigned long bcm2835_clock_choos
22 struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
23 struct bcm2835_cprman *cprman = clock->cprman;
24 const struct bcm2835_clock_data *data = clock->data;
25 - unsigned long best_rate;
26 + unsigned long best_rate = 0;
27 u32 curdiv, mindiv, maxdiv;
28 struct clk_hw *parent;
29