diff options
| author | Alexey Dobriyan <[email protected]> | 2021-05-07 01:02:13 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2021-05-07 02:24:11 +0000 |
| commit | b793cd9ab34da3c571a038219d1d6315f91e5afd (patch) | |
| tree | 474c58610d49d64cdc5c405a46991f354075e26a /fs/proc/generic.c | |
| parent | fs/proc/generic.c: fix incorrect pde_is_permanent check (diff) | |
| download | kernel-b793cd9ab34da3c571a038219d1d6315f91e5afd.tar.gz kernel-b793cd9ab34da3c571a038219d1d6315f91e5afd.zip | |
proc: save LOC in __xlate_proc_name()
Can't look at this verbosity anymore.
Link: https://lkml.kernel.org/r/YFYXAp/[email protected]
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
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); |
