Messages in this thread Patch in this message | | | From | Shida Zhang <> | Subject | [PATCH v2] cgroup: remove the superfluous judgment | Date | Wed, 18 May 2022 09:36:47 +0800 |
| |
Remove the superfluous judgment since the function is never called for a root cgroup, as suggested by Tejun.
Suggested-by: Tejun Heo <tj@kernel.org> Signed-off-by: Shida Zhang <zhangshida@kylinos.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
| |