]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hugetlb/cgroup: Remove unnecessary NULL checks
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sat, 21 Jul 2012 00:54:02 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Jul 2012 03:02:25 +0000 (13:02 +1000)
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 <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb_cgroup.c

index 76290a68a5f916b3fea9d9d20af2ef05f8c6f9a4..709cf77f7f1d0545c5b2d1e596146c13957309b1 100644 (file)
@@ -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;