diff options
| author | Mark Brown <broonie@kernel.org> | 2022-09-05 16:49:32 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2022-09-05 16:49:32 +0100 |
| commit | d2a411f810a0db055f02cc18e5cfa833bb2c9ccc (patch) | |
| tree | bce20a07308ef0d0a2d0121a6f4d482400d0e96e /include/linux/string_helpers.h | |
| parent | cdcdb008552670abd6f60a1777d3723e6ca2716b (diff) | |
| parent | b9163e9b5f14d690752010ee843b2d788c3536f1 (diff) | |
lib/string_helpers: Introduce parse_int_array_user()
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:
Continuation of recent upstream discussion [1] regarding user string
tokenization.
First, parse_int_array_user() is introduced to allow for splitting
specified user string into a sequence of integers. Makes use of
get_options() internally so the parsing logic is not duplicated.
With that done, redundant parts of the sound driver are removed.
Originally similar functionality was added for the SOF sound driver. As
more users are on the horizon, it is desirable to update existing
string_helpers code and provide a unified solution.
Diffstat (limited to 'include/linux/string_helpers.h')
| -rw-r--r-- | include/linux/string_helpers.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h index 4d72258d42fd..dc2e726fd820 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -21,6 +21,8 @@ enum string_size_units { void string_get_size(u64 size, u64 blk_size, enum string_size_units units, char *buf, int len); +int parse_int_array_user(const char __user *from, size_t count, int **array); + #define UNESCAPE_SPACE BIT(0) #define UNESCAPE_OCTAL BIT(1) #define UNESCAPE_HEX BIT(2) |
