summaryrefslogtreecommitdiff
path: root/mm/hugetlb_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hugetlb_cgroup.c')
-rw-r--r--mm/hugetlb_cgroup.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 95585a0b9c8d..57ecb5d2513f 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -59,11 +59,7 @@ static inline bool hugetlb_cgroup_is_root(struct hugetlb_cgroup *h_cg)
static inline struct hugetlb_cgroup *
parent_hugetlb_cgroup(struct hugetlb_cgroup *h_cg)
{
- struct cgroup *parent = h_cg->css.cgroup->parent;
-
- if (!parent)
- return NULL;
- return hugetlb_cgroup_from_cgroup(parent);
+ return hugetlb_cgroup_from_css(css_parent(&h_cg->css));
}
static inline bool hugetlb_cgroup_have_usage(struct hugetlb_cgroup *h_cg)