From: Alexey Dobriyan Date: Fri, 7 May 2021 01:02:13 +0000 (-0700) Subject: proc: save LOC in __xlate_proc_name() X-Git-Tag: v5.13-rc1~23^2~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b793cd9ab34da3c571a038219d1d6315f91e5afd;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 5600da30e289b..5b78739e60e40 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);