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

2016-12-07 Thread Heikki Krogerus
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]; > > +

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

2016-12-07 Thread Heikki Krogerus
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]; > > +

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

2016-12-07 Thread Guenter Roeck
On Thu, Nov 24, 2016 at 02:21:42PM +0200, Heikki Krogerus wrote: > Make a simple helper for matching strings with sysfs > attribute files. In most parts the same as match_string(), > except sysfs_match_string() uses sysfs_streq() instead of > strcmp() for matching. This is more convenient when

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

2016-12-07 Thread Guenter Roeck
On Thu, Nov 24, 2016 at 02:21:42PM +0200, Heikki Krogerus wrote: > Make a simple helper for matching strings with sysfs > attribute files. In most parts the same as match_string(), > except sysfs_match_string() uses sysfs_streq() instead of > strcmp() for matching. This is more convenient when