lkml.org 
[lkml]   [2020]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 07/14] iio: sx9310: Use long instead of int for channel bitmaps
On Fri, Jul 31, 2020 at 6:45 PM Daniel Campello <campello@chromium.org> wrote:
> On Wed, Jul 29, 2020 at 1:00 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Wed, Jul 29, 2020 at 4:03 AM Stephen Boyd <swboyd@chromium.org> wrote:
> > > Quoting Daniel Campello (2020-07-28 16:05:13)
> > > > Uses for_each_set_bit() macro to loop over channel bitmaps.
> >
> > ...
> >
> > > > + unsigned long chan_prox_stat;
> > >
> > > This can be DECLARE_BITMAP(chan_prox_stat, SX9310_NUM_CHANNELS)
> >
> > > > + unsigned long chan_read;
> > > > + unsigned long chan_event;
> > >
> > > Same for these?
> All of these are eventually used by regmap_update_bits() which expects
> unsigned int. I believe the extra complexity is not worth it given the
> number of channels.

Okay then. Good to have some build check for the limitation, so, what
about adding

static_assert(..._NUM_CHANNELS < BITS_PER_LONG);
after the _NUM_CHANNELS definition?

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-07-31 17:53    [W:0.271 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site