From: Yu Watanabe Date: Wed, 23 Mar 2022 05:30:24 +0000 (+0900) Subject: core/namespace: inline one more iterator variable X-Git-Tag: v251-rc1~54^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e7bf2fcab00a9cf62b223802e58459cd82e22189;p=thirdparty%2Fsystemd.git core/namespace: inline one more iterator variable --- diff --git a/src/core/namespace.c b/src/core/namespace.c index 2d5bedbbcdb..4ede17788b1 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -771,22 +771,20 @@ static void drop_nop(MountEntry *m, size_t *n) { /* Only suppress such subtrees for READONLY, READWRITE and READWRITE_IMPLICIT entries */ if (IN_SET(f->mode, READONLY, READWRITE, READWRITE_IMPLICIT)) { - MountEntry *p; - bool found = false; + MountEntry *found = NULL; /* Now let's find the first parent of the entry we are looking at. */ - for (p = t-1; p >= m; p--) { + for (MountEntry *p = PTR_SUB1(t, m); p; p = PTR_SUB1(p, m)) if (path_startswith(mount_entry_path(f), mount_entry_path(p))) { - found = true; + found = p; break; } - } /* We found it, let's see if it's the same mode, if so, we can drop this entry */ - if (found && p->mode == f->mode) { + if (found && found->mode == f->mode) { log_debug("%s (%s) is made redundant by %s (%s)", mount_entry_path(f), mount_mode_to_string(f->mode), - mount_entry_path(p), mount_mode_to_string(p->mode)); + mount_entry_path(found), mount_mode_to_string(found->mode)); mount_entry_done(f); continue; }