Skip to content

lib/string_helpers: Introduce parse_int_array_user()

Cezary Rojewski alsa-devel lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 1 replyIn review
  2. v52 patches 4 repliesSuperseded
  3. v42 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v32 patches5 repliesSuperseded
v12 patches28 repliesSuperseded

Changes in v6 from the cover letter

- minor improvements in SOF code: dropped superfluous array-empty checks as suggested by Andy

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2lib/string_helpers: Introduce parse_int_array_user()include/linux/string_helpers.h lib/string_helpers.c+46 -00 replies
2/2ASoC: SOF: Remove strsplit_u32() and tokenize_input()sound/soc/sof/sof-client-probes.c+15 -890 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndy Shevchenko
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/2] lib/string_helpers: Introduce parse_int_array_user()

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.

Changes in v6:
- minor improvements in SOF code: dropped superfluous array-empty checks as suggested by Andy

Changes in v5:
- fixed kernel doc for parse_int_array_user()

Changes in v4:
- renamed the function to parse_int_array_user()
- at the name several local variable names have been reworded to match the above

Changes in v3:
- relocated tokenize_user_input() implementation to string_helpers as requested by Matthew

Changes in v2:
- reused get_options() so no parsing logic is duplicated
- simplified __user variant with help of memdup_user_nul() Both suggested by Andy, thanks for thorough review

[1]: https://lore.kernel.org/alsa-devel/[email protected]/

Cezary Rojewski (2):
lib/string_helpers: Introduce parse_int_array_user()
ASoC: SOF: Remove strsplit_u32() and tokenize_input()

 include/linux/string_helpers.h    |   2 +
 lib/string_helpers.c              |  44 +++++++++++++
 sound/soc/sof/sof-client-probes.c | 104 +++++-------------------------
 3 files changed, 61 insertions(+), 89 deletions(-)
Signature · 1 line
2.25.1