[PATCH v2] cgroup: remove the superfluous judgment

From: Shida Zhang
Date: Tue May 17 2022 - 21:37:54 EST


Remove the superfluous judgment since the function is
never called for a root cgroup, as suggested by Tejun.

Suggested-by: Tejun Heo <tj@xxxxxxxxxx>
Signed-off-by: Shida Zhang <zhangshida@xxxxxxxxxx>
---
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