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: <CA+U=DsoOa7PfSXNBfVimrd6f0kTKfORgnd2g_Po1+eXiy2cW3g@mail.gmail.com>
Date:   Tue, 22 Dec 2020 10:27:21 +0200
From:   Alexandru Ardelean <ardeleanalex@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Alexandru Ardelean <alexandru.ardelean@...log.com>,
        linux-iio <linux-iio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v4] iio: Handle enumerated properties with gaps

On Tue, Dec 22, 2020 at 9:21 AM Alexandru Ardelean
<ardeleanalex@...il.com> wrote:
>
> On Mon, Dec 21, 2020 at 8:02 PM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> >
> > On Mon, Dec 21, 2020 at 5:11 PM Alexandru Ardelean
> > <alexandru.ardelean@...log.com> wrote:
> > >
> > > From: Lars-Peter Clausen <lars@...afoo.de>
> > >
> > > Some enums might have gaps or reserved values in the middle of their value
> > > range. E.g. consider a 2-bit enum where the values 0, 1 and 3 have a
> > > meaning, but 2 is a reserved value and can not be used.
> > >
> > > Add support for such enums to the IIO enum helper functions. A reserved
> > > values is marked by setting its entry in the items array to NULL rather
> > > than the normal descriptive string value.
> >
> > ...
> >
> > > I tried a few shots at working with 'lib/string.c', and that went
> > > slow. The __sysfs_match_string_with_gaps() approach has stalled.
> > > https://lore.kernel.org/linux-iio/20190422140251.8960-1-alexandru.ardelean@analog.com/
> >
> > Hmm... If you are not going to push that forward, perhaps better is to  provide
> > iio_sysfs_match_string() and if we need it in the future for other
> > users, it would be easier to find and export. Also it will be a matter
> > of one line change in the caller.
>
> That can work as well.
> Maybe add the __sysfs_match_string_with_gaps() here directly?

Maybe I can try again to address __sysfs_match_string() in lib/string.c
But I don't want to touch 'match_string()' ; that is way too spread out.

>
> >
> > --
> > With Best Regards,
> > Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ