]> 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:01 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Jul 2012 03:02:24 +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 5a4e71c75ddc9e03cfffbab20896c2db6e35affd..968a083e1db6a751c2026af6a9735f791487c3c5 100644 (file)
@@ -32,9 +32,7 @@ struct hugetlb_cgroup *root_h_cgroup __read_mostly;
 static inline
 struct hugetlb_cgroup *hugetlb_cgroup_from_css(struct cgroup_subsys_state *s)
 {
-       if (s)
-               return container_of(s, struct hugetlb_cgroup, css);
-       return NULL;
+       return container_of(s, struct hugetlb_cgroup, css);
 }
 
 static inline