summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup/cgroup.c
diff options
context:
space:
mode:
authorShida Zhang <starzhangzsd@gmail.com>2022-05-18 03:36:47 +0200
committerTejun Heo <tj@kernel.org>2022-05-20 09:49:45 +0200
commitb154a017c92011d8f71ce804583e5f9c3d90bb9a (patch)
treeaf8175b607dfe7ab069fc0763ff0d87f95d76f3f /kernel/cgroup/cgroup.c
parentcgroup: Make cgroup_debug static (diff)
downloadlinux-b154a017c92011d8f71ce804583e5f9c3d90bb9a.tar.xz
linux-b154a017c92011d8f71ce804583e5f9c3d90bb9a.zip
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@kernel.org> Signed-off-by: Shida Zhang <zhangshida@kylinos.cn> Reviewed-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup/cgroup.c')
-rw-r--r--kernel/cgroup/cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index a97fd051430b..1779ccddb734 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);