summaryrefslogtreecommitdiffstats
path: root/include/linux/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/string.h')
-rw-r--r--include/linux/string.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h
index 26b6f6a66f83..c4011b28f3d8 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -135,6 +135,16 @@ static inline int strtobool(const char *s, bool *res)
135} 135}
136 136
137int match_string(const char * const *array, size_t n, const char *string); 137int match_string(const char * const *array, size_t n, const char *string);
138int __sysfs_match_string(const char * const *array, size_t n, const char *s);
139
140/**
141 * sysfs_match_string - matches given string in an array
142 * @_a: array of strings
143 * @_s: string to match with
144 *
145 * Helper for __sysfs_match_string(). Calculates the size of @a automatically.
146 */
147#define sysfs_match_string(_a, _s) __sysfs_match_string(_a, ARRAY_SIZE(_a), _s)
138 148
139#ifdef CONFIG_BINARY_PRINTF 149#ifdef CONFIG_BINARY_PRINTF
140int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); 150int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args);