From: Aneesh Kumar K.V Date: Sat, 21 Jul 2012 00:54:01 +0000 (+1000) Subject: hugetlb/cgroup: remove unnecessary NULL checks X-Git-Tag: next-20120725~1^2~244 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e9091371eecd7e1adb96cbf7f57e4e2d6278e803;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 5a4e71c75ddc..968a083e1db6 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -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