Linux clock framework development
 help / color / mirror / Atom feed
* [bug report] clk: mediatek: add missing cpu mux causing Mediatek cpufreq can't work
@ 2017-07-07  9:53 Dan Carpenter
  2017-07-08  6:39 ` Sean Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-07-07  9:53 UTC (permalink / raw)
  To: sean.wang; +Cc: linux-clk

Hello Sean Wang,

The patch 1e17de9049da: "clk: mediatek: add missing cpu mux causing
Mediatek cpufreq can't work" from May 5, 2017, leads to the following
static checker warning:

	drivers/clk/mediatek/clk-cpumux.c:39 clk_cpumux_get_parent()
	warn: signedness bug returning '(-22)'

drivers/clk/mediatek/clk-cpumux.c
    27  static u8 clk_cpumux_get_parent(struct clk_hw *hw)
    28  {
    29          struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw);
    30          int num_parents = clk_hw_get_num_parents(hw);
    31          unsigned int val;
    32  
    33          regmap_read(mux->regmap, mux->reg, &val);
    34  
    35          val >>= mux->shift;
    36          val &= mux->mask;
    37  
    38          if (val >= num_parents)
    39                  return -EINVAL;
                        ^^^^^^^^^^^^^^
Doesn't work for u8.

    40  
    41          return val;
    42  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-08  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07  9:53 [bug report] clk: mediatek: add missing cpu mux causing Mediatek cpufreq can't work Dan Carpenter
2017-07-08  6:39 ` Sean Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox