From e9091371eecd7e1adb96cbf7f57e4e2d6278e803 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Sat, 21 Jul 2012 10:54:01 +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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 -- 2.39.5