Skip to content

Commit d24f059

Browse files
kamalesh-babulalhtejun
authored andcommitted
cgroup: Avoid extra dereference in css_populate_dir()
Use css directly instead of dereferencing it from &cgroup->self, while adding the cgroup v2 cft base and psi files in css_populate_dir(). Both points to the same css, when css->ss is NULL, this avoids extra deferences and makes code consistent in usage across the function. Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent fd55c0a commit d24f059

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/cgroup/cgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,13 +1719,13 @@ static int css_populate_dir(struct cgroup_subsys_state *css)
17191719

17201720
if (!css->ss) {
17211721
if (cgroup_on_dfl(cgrp)) {
1722-
ret = cgroup_addrm_files(&cgrp->self, cgrp,
1722+
ret = cgroup_addrm_files(css, cgrp,
17231723
cgroup_base_files, true);
17241724
if (ret < 0)
17251725
return ret;
17261726

17271727
if (cgroup_psi_enabled()) {
1728-
ret = cgroup_addrm_files(&cgrp->self, cgrp,
1728+
ret = cgroup_addrm_files(css, cgrp,
17291729
cgroup_psi_files, true);
17301730
if (ret < 0)
17311731
return ret;

0 commit comments

Comments
 (0)