aboutsummaryrefslogtreecommitdiff
path: root/fs/proc
diff options
context:
space:
mode:
authorAlexey Dobriyan2021-05-06 18:02:13 -0700
committerLinus Torvalds2021-05-06 19:24:11 -0700
commitb793cd9ab34da3c571a038219d1d6315f91e5afd (patch)
tree474c58610d49d64cdc5c405a46991f354075e26a /fs/proc
parentf4bf74d82915708208bc9d0c9bd3f769f56bfbec (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')
-rw-r--r--fs/proc/generic.c11
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);