diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2020-03-04 13:29:19 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2020-03-04 13:29:19 +0000 |
| commit | d46eec8e975a8180e178e01ba505801c44bc9a6c (patch) | |
| tree | bff067e554fc03c576e107297085d30c8e381370 /lib/string.c | |
| parent | perf/x86: Add Intel Tiger Lake uncore support (diff) | |
| parent | perf diff: Fix undefined string comparison spotted by clang's -Wstring-compare (diff) | |
| download | kernel-d46eec8e975a8180e178e01ba505801c44bc9a6c.tar.gz kernel-d46eec8e975a8180e178e01ba505801c44bc9a6c.zip | |
Merge remote-tracking branch 'acme/perf/urgent' into perf/core
To pick up fixes.
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
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) { |
