Re: [PATCHv13,1/3] lib/string: add sysfs_match_string helper

From: Heikki Krogerus
Date: Thu Dec 08 2016 - 02:32:39 EST


On Wed, Dec 07, 2016 at 03:54:45PM -0800, Guenter Roeck wrote:
> > +int __sysfs_match_string(const char * const *array, size_t n, const char *str)
> > +{
> > + const char *item;
> > + int index;
> > +
> > + for (index = 0; index < n; index++) {
> > + item = array[index];
> > + if (!item)
> > + break;
> > + if (!sysfs_streq(item, str))
>
> No idea how this slipped in: sysfs_streq() returns true on a match,
> meaning the "!" here is wrong.

Good catch. Thanks Guenter.

--
heikki