[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220518013647.1749568-1-zhangshida@kylinos.cn>
Date: Wed, 18 May 2022 09:36:47 +0800
From: Shida Zhang <starzhangzsd@...il.com>
To: tj@...nel.org, lizefan.x@...edance.com, hannes@...xchg.org
Cc: zhangshida@...inos.cn, starzhangzsd@...il.com,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org
Subject: [PATCH v2] cgroup: remove the superfluous judgment
Remove the superfluous judgment since the function is
never called for a root cgroup, as suggested by Tejun.
Suggested-by: Tejun Heo <tj@...nel.org>
Signed-off-by: Shida Zhang <zhangshida@...inos.cn>
---
Changes from v1:
- Just remove the superfluous judgment instead.
kernel/cgroup/cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index adb820e98f24..7d8a463c461b 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5685,7 +5685,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
css_clear_dir(&cgrp->self);
kernfs_remove(cgrp->kn);
- if (parent && cgroup_is_threaded(cgrp))
+ if (cgroup_is_threaded(cgrp))
parent->nr_threaded_children--;
spin_lock_irq(&css_set_lock);
--
2.25.1
Powered by blists - more mailing lists