All of lore.kernel.org
 help / color / mirror / Atom feed
* re: clk: sunxi: Add TCON channel1 clock
@ 2016-04-23 10:25 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-04-23 10:25 UTC (permalink / raw)
  To: maxime.ripard; +Cc: linux-clk

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-23 10:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-23 10:25 clk: sunxi: Add TCON channel1 clock Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.