Skip to content

Commit

Permalink
fs/proc/generic.c: delete useless "len" variable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and torvalds committed Dec 5, 2019
1 parent e06689b commit 5f6354e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit 5f6354e

Please sign in to comment.