aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/string_helpers.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-11-05 14:42:24 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-11-18 18:40:08 +0200
commit418e0a3551bbef5b221705b0e5b8412cdc0afd39 (patch)
tree39e7d5c9c41662022115ba66fb470e993bc8153b /include/linux/string_helpers.h
parentLinux 5.16-rc1 (diff)
downloadwireguard-linux-418e0a3551bbef5b221705b0e5b8412cdc0afd39.tar.xz
wireguard-linux-418e0a3551bbef5b221705b0e5b8412cdc0afd39.zip
lib/string_helpers: Introduce kasprintf_strarray()
We have a few users already that basically want to have array of sequential strings to be allocated and filled. Provide a helper for them (basically adjusted version from gpio-mockup.c). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/string_helpers.h')
-rw-r--r--include/linux/string_helpers.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index 4ba39e1403b2..f67a94013c87 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -100,6 +100,7 @@ char *kstrdup_quotable(const char *src, gfp_t gfp);
char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp);
char *kstrdup_quotable_file(struct file *file, gfp_t gfp);
+char **kasprintf_strarray(gfp_t gfp, const char *prefix, size_t n);
void kfree_strarray(char **array, size_t n);
#endif