clk: sunxi: Add TCON channel1 clock
Hello Maxime Ripard,
The patch cc510c736b1b: "clk: sunxi: Add TCON channel1 clock" from Jul 1, 2015, leads to the following static checker warning:
drivers/clk/sunxi/clk-sun4i-tcon-ch1.c:89 tcon_ch1_get_parent() warn: signedness bug returning '(-22)'
drivers/clk/sunxi/clk-sun4i-tcon-ch1.c
79 static u8 tcon_ch1_get_parent(struct clk_hw *hw)
^^
Is u8.
80 {
81 struct tcon_ch1_clk *tclk = hw_to_tclk(hw);
82 int num_parents = clk_hw_get_num_parents(hw);
83 u32 reg;
84
85 reg = readl(tclk->reg) >> TCON_CH1_SCLK2_MUX_SHIFT;
86 reg &= reg >> TCON_CH1_SCLK2_MUX_MASK;
87
88 if (reg >= num_parents)
89 return -EINVAL;
^^^^^^^^^^^^^^Can't fit.
90
91 return reg;
92 }regards,
dan carpenter