Re: [PATCH v6 1/2] lib/string.c: add __sysfs_match_string_with_gaps() helper

2020-12-22 Thread Alexandru Ardelean
On Tue, Dec 22, 2020 at 3:43 PM Andy Shevchenko wrote: > > On Tue, Dec 22, 2020 at 3:09 PM Alexandru Ardelean > wrote: > > > > The original docstring of the __sysfs_match_string() and match_string() > > helper, implied that -1 could be used to search through NULL terminated > > arrays, and

Re: [PATCH v6 1/2] lib/string.c: add __sysfs_match_string_with_gaps() helper

2020-12-22 Thread Andy Shevchenko
On Tue, Dec 22, 2020 at 3:09 PM Alexandru Ardelean wrote: > > The original docstring of the __sysfs_match_string() and match_string() > helper, implied that -1 could be used to search through NULL terminated > arrays, and positive 'n' could be used to go through arrays that may have > NULL

[PATCH v6 1/2] lib/string.c: add __sysfs_match_string_with_gaps() helper

2020-12-22 Thread Alexandru Ardelean
The original docstring of the __sysfs_match_string() and match_string() helper, implied that -1 could be used to search through NULL terminated arrays, and positive 'n' could be used to go through arrays that may have NULL elements in the middle of the array. This isn't true. Regardless of the