summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2019-12-04 10:02:26 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2019-12-04 10:02:26 +1100
commitbd9f5d43c1931ac988ed4b2b4bf32edff82156f0 (patch)
treea281f101c3162e602e550fbc092f0fba7092a1aa /fs
parent8e75652af447c3f295eb9167e8bf33e0c7bfd1a7 (diff)
downloadlinux-next-bd9f5d43c1931ac988ed4b2b4bf32edff82156f0.tar.gz
fs/proc/generic.c: delete useless "len" variable
Pointer to next '/' encodes length of path element and next start position. Subtraction and increment are redundant. Link: http://lkml.kernel.org/r/20191004234521.GA30246@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/generic.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index d4f353187d67..074e9585c699 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -163,7 +163,6 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
{
const char *cp = name, *next;
struct proc_dir_entry *de;
- unsigned int len;
de = *ret;
if (!de)
@@ -174,13 +173,12 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
if (!next)
break;
- len = next - cp;
- de = pde_subdir_find(de, cp, len);
+ de = pde_subdir_find(de, cp, next - cp);
if (!de) {
WARN(1, "name '%s'\n", name);
return -ENOENT;
}
- cp += len + 1;
+ cp = next + 1;
}
*residual = cp;
*ret = de;