[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211004084928.17622-3-richard.weiyang@gmail.com>
Date: Mon, 4 Oct 2021 08:49:27 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: tj@...nel.org, lizefan.x@...edance.com, hannes@...xchg.org
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Wei Yang <richard.weiyang@...il.com>
Subject: [PATCH 3/4] cgroup: simplify the cgroup descendant helper
cgroup_for_each_live_descendant_[pre|post] use cgroup_css() to get the
root. While since the 2nd parameter is NULL, cgroup_css() always return
cgrp->self.
Let's simplify this a little.
Signed-off-by: Wei Yang <richard.weiyang@...il.com>
---
kernel/cgroup/cgroup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 570b0c97392a..457353aeb0ca 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -732,7 +732,7 @@ EXPORT_SYMBOL_GPL(of_css);
/* walk live descendants in pre order */
#define cgroup_for_each_live_descendant_pre(dsct, d_css, cgrp) \
- css_for_each_descendant_pre((d_css), cgroup_css((cgrp), NULL)) \
+ css_for_each_descendant_pre((d_css), &(cgrp)->self) \
if (({ lockdep_assert_held(&cgroup_mutex); \
(dsct) = (d_css)->cgroup; \
cgroup_is_dead(dsct); })) \
@@ -741,7 +741,7 @@ EXPORT_SYMBOL_GPL(of_css);
/* walk live descendants in postorder */
#define cgroup_for_each_live_descendant_post(dsct, d_css, cgrp) \
- css_for_each_descendant_post((d_css), cgroup_css((cgrp), NULL)) \
+ css_for_each_descendant_post((d_css), &(cgrp)->self) \
if (({ lockdep_assert_held(&cgroup_mutex); \
(dsct) = (d_css)->cgroup; \
cgroup_is_dead(dsct); })) \
--
2.23.0
Powered by blists - more mailing lists