diff options
author | 2023-07-24 15:44:47 +0200 | |
---|---|---|
committer | 2023-07-24 15:44:47 +0200 | |
commit | 61b7369483efb5e0a9f3b48e75fac00d46d661e0 (patch) | |
tree | 6a97cc6f8857f0d26dcd48627aa6f31b9875b07e /lib/string_helpers.c | |
parent | drm/managed: Clean up GFP_ flag usage in drmm_kmalloc() (diff) | |
parent | Merge tag 'drm-misc-next-2023-07-13' of git://anongit.freedesktop.org/drm/drm-misc into drm-next (diff) | |
download | wireguard-linux-61b7369483efb5e0a9f3b48e75fac00d46d661e0.tar.xz wireguard-linux-61b7369483efb5e0a9f3b48e75fac00d46d661e0.zip |
Merge drm/drm-next into drm-misc-next
Backmerging to get v6.5-rc2.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'lib/string_helpers.c')
-rw-r--r-- | lib/string_helpers.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/string_helpers.c b/lib/string_helpers.c index 230020a2e076..d3b1dd718daf 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -979,18 +979,22 @@ EXPORT_SYMBOL(__sysfs_match_string); /** * strreplace - Replace all occurrences of character in string. - * @s: The string to operate on. + * @str: The string to operate on. * @old: The character being replaced. * @new: The character @old is replaced with. * - * Returns pointer to the nul byte at the end of @s. + * Replaces the each @old character with a @new one in the given string @str. + * + * Return: pointer to the string @str itself. */ -char *strreplace(char *s, char old, char new) +char *strreplace(char *str, char old, char new) { + char *s = str; + for (; *s; ++s) if (*s == old) *s = new; - return s; + return str; } EXPORT_SYMBOL(strreplace); |