From: Aneesh Kumar K.V Date: Sat, 21 Jul 2012 00:54:02 +0000 (+1000) Subject: hugetlb/cgroup: Remove unnecessary NULL checks X-Git-Tag: next-20120725~1^2~240 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=08a4a9efa2650c220499ba80b334f57ed4006e18;p=karo-tx-linux.git 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 --- 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;