Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: lpc32xx: fix compilation warning

Remove the following false positives compilation warning:
- drivers/clk/nxp/clk-lpc32xx.c: In function 'lpc32xx_clk_register':
warning: 'hw' may be used uninitialized in this function [-Wmaybe-uninitialized]
- drivers/clk/nxp/clk-lpc32xx.c: In function 'clk_hclk_pll_round_rate':
warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized]
warning: 'n' may be used uninitialized in this function [-Wmaybe-uninitialized]
warning: 'm' may be used uninitialized in this function [-Wmaybe-uninitialized]

Tested using gcc version 4.7.3.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
[sboyd@codeaurora.org: Drop assignment of hw to NULL as return
silences it and is less likely to lead to hiding problems later]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Sylvain Lemieux and committed by
Stephen Boyd
8626556f 0f4c7a13

+4 -1
+4 -1
drivers/clk/nxp/clk-lpc32xx.c
··· 588 588 unsigned long *parent_rate) 589 589 { 590 590 struct lpc32xx_pll_clk *clk = to_lpc32xx_pll_clk(hw); 591 - u64 m_i, m, n, p, o = rate, i = *parent_rate, d = (u64)rate << 6; 591 + u64 m_i, o = rate, i = *parent_rate, d = (u64)rate << 6; 592 + u64 m = 0, n = 0, p = 0; 592 593 int p_i, n_i; 593 594 594 595 pr_debug("%s: %lu/%lu\n", clk_hw_get_name(hw), *parent_rate, rate); ··· 1429 1428 hw = &clk_hw->hw0.div.hw; 1430 1429 else if (clk_hw->type == CLK_GATE) 1431 1430 hw = &clk_hw->hw0.gate.hw; 1431 + else 1432 + return ERR_PTR(-EINVAL); 1432 1433 1433 1434 hw->init = &clk_init; 1434 1435 clk = clk_register(NULL, hw);