clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate()
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Mon, 12 Dec 2016 08:00:53 +0000 (09:00 +0100)
committerStephen Boyd <sboyd@codeaurora.org>
Mon, 12 Dec 2016 19:25:40 +0000 (11:25 -0800)
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>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/bcm/clk-bcm2835.c

index eaf82f49dedeed5e38ee81f01eef7f1e34554c7c..0d14409097e777ce4546de30e9278fdebf74ec44 100644 (file)
@@ -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;