Skip to content

Commit 0da41f7

Browse files
RichardWeiYanghtejun
authored andcommitted
cgroup: rstat: explicitly put loop variant in while
Instead of do while unconditionally, let's put the loop variant in while. Signed-off-by: Wei Yang <[email protected]> Reviewed-by: Michal Koutný <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 1815775 commit 0da41f7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

kernel/cgroup/rstat.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,10 @@ static struct cgroup *cgroup_rstat_cpu_pop_updated(struct cgroup *pos,
124124

125125
prstatc = cgroup_rstat_cpu(parent, cpu);
126126
nextp = &prstatc->updated_children;
127-
while (true) {
127+
while (*nextp != pos) {
128128
struct cgroup_rstat_cpu *nrstatc;
129129

130130
nrstatc = cgroup_rstat_cpu(*nextp, cpu);
131-
if (*nextp == pos)
132-
break;
133131
WARN_ON_ONCE(*nextp == parent);
134132
nextp = &nrstatc->updated_next;
135133
}

0 commit comments

Comments
 (0)