diff options
| author | Mark Brown <broonie@kernel.org> | 2020-03-11 18:45:26 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2020-03-11 18:45:26 +0000 |
| commit | 4d90a4e677c5c45c787a774c84442e75c7ddd5be (patch) | |
| tree | 50312d13362dd49615148661ae7e6d91ac349719 /lib/string.c | |
| parent | 9032cdd96a2d4b0ef2f43499328f8a68050be2ec (diff) | |
| parent | 2c523b344dfa65a3738e7039832044aa133c75fb (diff) | |
Merge tag 'v5.6-rc5' into asoc-5.7
Linux 5.6-rc5
Diffstat (limited to 'lib/string.c')
| -rw-r--r-- | lib/string.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c index f607b967d978..6012c385fb31 100644 --- a/lib/string.c +++ b/lib/string.c @@ -699,6 +699,14 @@ EXPORT_SYMBOL(sysfs_streq); * @n: number of strings in the array or -1 for NULL terminated arrays * @string: string to match with * + * This routine will look for a string in an array of strings up to the + * n-th element in the array or until the first NULL element. + * + * Historically the value of -1 for @n, was used to search in arrays that + * are NULL terminated. However, the function does not make a distinction + * when finishing the search: either @n elements have been compared OR + * the first NULL element was found. + * * Return: * index of a @string in the @array if matches, or %-EINVAL otherwise. */ @@ -727,6 +735,14 @@ EXPORT_SYMBOL(match_string); * * Returns index of @str in the @array or -EINVAL, just like match_string(). * Uses sysfs_streq instead of strcmp for matching. + * + * This routine will look for a string in an array of strings up to the + * n-th element in the array or until the first NULL element. + * + * Historically the value of -1 for @n, was used to search in arrays that + * are NULL terminated. However, the function does not make a distinction + * when finishing the search: either @n elements have been compared OR + * the first NULL element was found. */ int __sysfs_match_string(const char * const *array, size_t n, const char *str) { |
