lkml.org 
[lkml]   [2015]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 2/8] clk: mmp: switch to GENMASK()
From
Date
On Tue, 2015-07-21 at 16:53 -0700, Stephen Boyd wrote:
> On 07/13, Andy Shevchenko wrote:
> > diff --git a/drivers/clk/mmp/clk.h b/drivers/clk/mmp/clk.h
> > index adf9b71..f5fdb0e 100644
> > --- a/drivers/clk/mmp/clk.h
> > +++ b/drivers/clk/mmp/clk.h
> > @@ -39,7 +39,7 @@ extern struct clk *mmp_clk_register_factor(const
> > char *name,
> >
> > /* Clock type "mix" */
> > #define MMP_CLK_BITS_MASK(width, shift) \
> > - (((1 << (width)) - 1) << (shift))
> > + (GENMASK((width) - 1, 0) << (shift))
>
> This can push the shift into the GENMASK instance too:

Too not optimal. I checked the assembly.

>
> (GENMASK((width) - 1 + (shift), (shift))
>
> > #define MMP_CLK_BITS_GET_VAL(data, width, shift) \
> > ((data & MMP_CLK_BITS_MASK(width, shift)) >>
> > (shift))
> > #define MMP_CLK_BITS_SET_VAL(val, width, shift) \
> > --
> > 2.1.4
> >
>

--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy


\
 
 \ /
  Last update: 2015-07-22 15:21    [W:0.105 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site