lib/string_helpers: Change returned value of the strreplace()
[linux-2.6-block.git] / lib / string_helpers.c
index 230020a2e076ce9e14e2a2c960218eac5f6e0134..d3b1dd718dafbd4a46a148cf68089851c8fd64ae 100644 (file)
@@ -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);