mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
lib/string_helpers: Introduce parse_int_array_user()
Add new helper function to allow for splitting specified user string into a sequence of integers. Internally it makes use of get_options() so the returned sequence contains the integers extracted plus an additional element that begins the sequence and specifies the integers count. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220904102840.862395-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
376be51caf
commit
f0b933236e
2 changed files with 46 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue