diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2021-05-06 18:02:13 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-05-06 19:24:11 -0700 |
commit | b793cd9ab34da3c571a038219d1d6315f91e5afd (patch) | |
tree | 474c58610d49d64cdc5c405a46991f354075e26a /fs/proc/generic.c | |
parent | f4bf74d82915708208bc9d0c9bd3f769f56bfbec (diff) |
proc: save LOC in __xlate_proc_name()
Can't look at this verbosity anymore.
Link: https://lkml.kernel.org/r/YFYXAp/fgq405qcy@localhost.localdomain
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r-- | fs/proc/generic.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 5600da30e289..5b78739e60e4 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -166,15 +166,8 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret, const char *cp = name, *next; struct proc_dir_entry *de; - de = *ret; - if (!de) - de = &proc_root; - - while (1) { - next = strchr(cp, '/'); - if (!next) - break; - + de = *ret ?: &proc_root; + while ((next = strchr(cp, '/')) != NULL) { de = pde_subdir_find(de, cp, next - cp); if (!de) { WARN(1, "name '%s'\n", name); |