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: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Alexey Dobriyan 2019-12-04 16:50:02 -08:00 committed by Linus Torvalds
parent e06689bf57
commit 5f6354eaa5
1 changed files with 2 additions and 4 deletions

View File

@ -163,7 +163,6 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
{ {
const char *cp = name, *next; const char *cp = name, *next;
struct proc_dir_entry *de; struct proc_dir_entry *de;
unsigned int len;
de = *ret; de = *ret;
if (!de) if (!de)
@ -174,13 +173,12 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
if (!next) if (!next)
break; break;
len = next - cp; de = pde_subdir_find(de, cp, next - cp);
de = pde_subdir_find(de, cp, len);
if (!de) { if (!de) {
WARN(1, "name '%s'\n", name); WARN(1, "name '%s'\n", name);
return -ENOENT; return -ENOENT;
} }
cp += len + 1; cp = next + 1;
} }
*residual = cp; *residual = cp;
*ret = de; *ret = de;