Skip to contentSkip to conversation

proc: save LOC in __xlate_proc_name()

PATCH New Alexey Dobriyan 1 participant 1 message Mar 20, 2021 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proc: save LOC in __xlate_proc_name()

Can't look at this verbosity anymore.

---

 fs/proc/generic.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
fs/proc/generic.c +2 -9
@@ -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, '/'))) {
 		de = pde_subdir_find(de, cp, next - cp);
 		if (!de) {
 			WARN(1, "name '%s'\n", name);