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

2020-12-22 Thread Alexandru Ardelean
On Tue, Dec 22, 2020 at 1:13 PM Greg KH wrote: > > On Tue, Dec 22, 2020 at 11:52:09AM +0200, 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

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

2020-12-22 Thread Greg KH
On Tue, Dec 22, 2020 at 11:52:09AM +0200, 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' can be used to go through arrays that may have > NULL el

[PATCH v5 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' can be used to go through arrays that may have NULL elements in the middle of the array. This isn't true. Regardless of the value