summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2026-08-14 07:14:18 +0300
committerPaulo Alcantara <pc@manguebit.org>2026-08-24 17:08:53 -0300
commit3fffaa8a646c5bee02a553014b7f80e6ea2a76dd (patch)
tree0ee4b4f8543ab3e6b8f3800645a0b4639f1465d6
parent730d0bb19507b9e19c2fe5343109ac618e2fbce5 (diff)
downloadlinux-3fffaa8a646c5bee02a553014b7f80e6ea2a76dd.tar.gz
linux-3fffaa8a646c5bee02a553014b7f80e6ea2a76dd.zip
smb: client: simplify __build_path_from_dentry_optional_prefix()
Use the convenient 'strreplace()' to simplify '__build_path_from_dentry_optional_prefix()'. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Paulo Alcantara <pc@manguebit.org>
-rw-r--r--fs/smb/client/dir.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
index b0ddcaa2d815..c292e3cd623b 100644
--- a/fs/smb/client/dir.c
+++ b/fs/smb/client/dir.c
@@ -115,11 +115,7 @@ char *__build_path_from_dentry_optional_prefix(struct dentry *direntry, void *pa
}
if (dirsep != '/') {
/* BB test paths to Windows with '/' in the midst of prepath */
- char *p;
-
- for (p = s; *p; p++)
- if (*p == '/')
- *p = dirsep;
+ strreplace(s, '/', dirsep);
}
if (dfsplen) {
s -= dfsplen;