0583-clk-bcm-Fix-maybe-uninitialized-warning-in-bcm2835_c.patch 1.2 KB

1234567891011121314151617181920212223242526272829
  1. From d4be0d5751c1bfe067a07a4ec95d7575ec03ab83 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. best_rate is reported as potentially uninitialized by gcc.
  7. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
  8. Fixes: 155e8b3b0ee3 ("clk: bcm: Support rate change propagation on bcm2835 clocks")
  9. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
  10. Reviewed-by: Eric Anholt <eric@anholt.net>
  11. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  12. (cherry picked from commit 2aab7a2055a1705c9e30920d95a596226999eb21)
  13. ---
  14. drivers/clk/bcm/clk-bcm2835.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. --- a/drivers/clk/bcm/clk-bcm2835.c
  17. +++ b/drivers/clk/bcm/clk-bcm2835.c
  18. @@ -1073,7 +1073,7 @@ static unsigned long bcm2835_clock_choos
  19. struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
  20. struct bcm2835_cprman *cprman = clock->cprman;
  21. const struct bcm2835_clock_data *data = clock->data;
  22. - unsigned long best_rate;
  23. + unsigned long best_rate = 0;
  24. u32 curdiv, mindiv, maxdiv;
  25. struct clk_hw *parent;