From 08a4a9efa2650c220499ba80b334f57ed4006e18 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Sat, 21 Jul 2012 10:54:02 +1000 Subject: [PATCH] hugetlb/cgroup: Remove unnecessary NULL checks cgroup_subsys_state can never be NULL, so don't check for that in hugetlb_cgroup_from_css. Also current task will always be part of some cgroup. So hugetlb_cgrop_from_task cannot return NULL. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Andrew Morton --- mm/hugetlb_cgroup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index 76290a68a5f9..709cf77f7f1d 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -130,9 +130,6 @@ int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages, again: rcu_read_lock(); h_cg = hugetlb_cgroup_from_task(current); - if (!h_cg) - h_cg = root_h_cgroup; - if (!css_tryget(&h_cg->css)) { rcu_read_unlock(); goto again; -- 2.39.5