mbox series

[v6,0/2] lib/string_helpers: Introduce parse_int_array_user()

Message ID 20220904102840.862395-1-cezary.rojewski@intel.com
Headers show
Series lib/string_helpers: Introduce parse_int_array_user() | expand

Message

Cezary Rojewski Sept. 4, 2022, 10:28 a.m. UTC
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/20220707091301.1282291-1-cezary.rojewski@intel.com/


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(-)

Comments

Mark Brown Sept. 5, 2022, 3:50 p.m. UTC | #1
On Sun, 4 Sep 2022 12:28:38 +0200, Cezary Rojewski wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] lib/string_helpers: Introduce parse_int_array_user()
      commit: d2a411f810a0db055f02cc18e5cfa833bb2c9ccc
[2/2] ASoC: SOF: Remove strsplit_u32() and tokenize_input()
      commit: b9163e9b5f14d690752010ee843b2d788c3536f1

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark