aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/string_helpers.h
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2025-04-04 11:03:30 +0200
committerMark Brown <broonie@kernel.org>2025-04-07 15:07:56 +0100
commit83b9ae77f06607d19f7d3dcc6008742051137b27 (patch)
tree7fabf590b4336c710a46dadc5df9bfb636300d50 /include/linux/string_helpers.h
parentLinux 6.15-rc1 (diff)
downloadlinux-rng-83b9ae77f06607d19f7d3dcc6008742051137b27.tar.xz
linux-rng-83b9ae77f06607d19f7d3dcc6008742051137b27.zip
lib/string_helpers: Introduce parse_int_array()
Existing parse_inte_array_user() works with __user buffers only. Separate array parsing from __user bits so the functionality can be utilized with kernel buffers too. Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20250404090337.3564117-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.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 e93fbb5b0c01..3fb88a1e9898 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -31,6 +31,7 @@ enum string_size_units {
int string_get_size(u64 size, u64 blk_size, const enum string_size_units units,
char *buf, int len);
+int parse_int_array(const char *buf, size_t count, int **array);
int parse_int_array_user(const char __user *from, size_t count, int **array);
#define UNESCAPE_SPACE BIT(0)