Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1189882
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 2/8] clk: mmp: switch to GENMASK() |
| Date | 2015-07-22 15:10 +0200 |
| Message-ID | <pP1Wx-7Id-11@gated-at.bofh.it> (permalink) |
| References | <pLMAF-612-3@gated-at.bofh.it> <pLMAG-612-13@gated-at.bofh.it> <pOPC1-6FT-9@gated-at.bofh.it> |
| Organization | Intel Finland Oy |
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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH v5 2/8] clk: mmp: switch to GENMASK() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-07-22 15:10 +0200
csiph-web