linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: ARM: OMAP4: clock: Convert to common clk
@ 2015-07-20 21:48 Dan Carpenter
  2015-07-24  0:18 ` Michael Turquette
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-07-20 21:48 UTC (permalink / raw)
  To: mturquette; +Cc: linux-clk

Hello Mike Turquette,

The patch 32cc002116b8: "ARM: OMAP4: clock: Convert to common clk"
from Nov 10, 2012, leads to the following Smatch warning:

	drivers/clk/ti/clkt_dpll.c:213 omap2_init_dpll_parent()
	warn: signedness bug returning '(-22)'

drivers/clk/ti/clkt_dpll.c
   204  /* Public functions */
   205  u8 omap2_init_dpll_parent(struct clk_hw *hw)
        ^^

   206  {
   207          struct clk_hw_omap *clk = to_clk_hw_omap(hw);
   208          u32 v;
   209          struct dpll_data *dd;
   210  
   211          dd = clk->dpll_data;
   212          if (!dd)
   213                  return -EINVAL;
                               ^^^^^^^
Truncated to positive u8.

   214  
   215          v = ti_clk_ll_ops->clk_readl(dd->control_reg);
   216          v &= dd->enable_mask;
   217          v >>= __ffs(dd->enable_mask);
   218  
   219          /* Reparent the struct clk in case the dpll is in bypass */
   220          if (_omap2_dpll_is_in_bypass(v))
   221                  return 1;
   222  
   223          return 0;
   224  }

regards,
dan carpenter

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

* re: ARM: OMAP4: clock: Convert to common clk
  2015-07-20 21:48 ARM: OMAP4: clock: Convert to common clk Dan Carpenter
@ 2015-07-24  0:18 ` Michael Turquette
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Turquette @ 2015-07-24  0:18 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-clk, Tero Kristo

Quoting Dan Carpenter (2015-07-20 14:48:55)
> Hello Mike Turquette,
> =

> The patch 32cc002116b8: "ARM: OMAP4: clock: Convert to common clk"
> from Nov 10, 2012, leads to the following Smatch warning:
> =

>         drivers/clk/ti/clkt_dpll.c:213 omap2_init_dpll_parent()
>         warn: signedness bug returning '(-22)'
> =

> drivers/clk/ti/clkt_dpll.c
>    204  /* Public functions */
>    205  u8 omap2_init_dpll_parent(struct clk_hw *hw)
>         ^^
> =

>    206  {
>    207          struct clk_hw_omap *clk =3D to_clk_hw_omap(hw);
>    208          u32 v;
>    209          struct dpll_data *dd;
>    210  =

>    211          dd =3D clk->dpll_data;
>    212          if (!dd)
>    213                  return -EINVAL;
>                                ^^^^^^^
> Truncated to positive u8.

Thanks Dan.

Tero,

Looks like this still exists at line 237 in clk-next.

Regards,
Mike

> =

>    214  =

>    215          v =3D ti_clk_ll_ops->clk_readl(dd->control_reg);
>    216          v &=3D dd->enable_mask;
>    217          v >>=3D __ffs(dd->enable_mask);
>    218  =

>    219          /* Reparent the struct clk in case the dpll is in bypass =
*/
>    220          if (_omap2_dpll_is_in_bypass(v))
>    221                  return 1;
>    222  =

>    223          return 0;
>    224  }
> =

> regards,
> dan carpenter

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

end of thread, other threads:[~2015-07-24  0:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-20 21:48 ARM: OMAP4: clock: Convert to common clk Dan Carpenter
2015-07-24  0:18 ` Michael Turquette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).