lib/string_helpers: Add kstrdup_and_replace() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 4 Aug 2023 14:39:07 +0000 (17:39 +0300)
committerStephen Boyd <sboyd@kernel.org>
Sat, 5 Aug 2023 01:21:50 +0000 (18:21 -0700)
commit045ad46441a1cf2ff358af0126f8c57f337804fa
tree0d8745d448f22648486c123c18e055aef20be105
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
lib/string_helpers: Add kstrdup_and_replace() helper

Duplicate a NULL-terminated string and replace all occurrences of
the old character with a new one. In other words, provide functionality
of kstrdup() + strreplace().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230804143910.15504-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
include/linux/string_helpers.h
lib/string_helpers.c