lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VeoS-K7v=iJLuFqXQJpqUjmdopJraUGOiOURekCh0=QTA@mail.gmail.com>
Date:   Fri, 31 Jul 2020 18:52:00 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Daniel Campello <campello@...omium.org>
Cc:     Stephen Boyd <swboyd@...omium.org>,
        LKML <devicetree@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Douglas Anderson <dianders@...omium.org>,
        Enrico Granata <egranata@...omium.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        linux-iio <linux-iio@...r.kernel.org>
Subject: Re: [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@...omium.org> wrote:
> On Wed, Jul 29, 2020 at 1:00 AM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> >
> > On Wed, Jul 29, 2020 at 4:03 AM Stephen Boyd <swboyd@...omium.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ