summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZefan Li <lizefan@huawei.com>2014-09-19 16:29:31 +0800
committerTejun Heo <tj@kernel.org>2014-09-19 09:16:23 -0400
commitf29374b146dd02f5f99742aedaddd6ef3512fc9c (patch)
tree107e75d26d7a8a6a88747a9f5ef78e0a8405ff3d
parent52de4779f201758ddcf37360f09a16895756e708 (diff)
downloadlinux-f29374b146dd02f5f99742aedaddd6ef3512fc9c.tar.gz
linux-f29374b146dd02f5f99742aedaddd6ef3512fc9c.tar.bz2
linux-f29374b146dd02f5f99742aedaddd6ef3512fc9c.zip
cgroup: remove redundant check in cgroup_ino()
After we implemented default unified hierarchy, cgrp->kn can never be NULL. Signed-off-by: Zefan Li <lizefan@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--include/linux/cgroup.h7
-rw-r--r--mm/memory-failure.c2
2 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 77a1d37b742b..818a81fe7ccc 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -532,13 +532,10 @@ static inline bool cgroup_has_tasks(struct cgroup *cgrp)
return !list_empty(&cgrp->cset_links);
}
-/* returns ino associated with a cgroup, 0 indicates unmounted root */
+/* returns ino associated with a cgroup */
static inline ino_t cgroup_ino(struct cgroup *cgrp)
{
- if (cgrp->kn)
- return cgrp->kn->ino;
- else
- return 0;
+ return cgrp->kn->ino;
}
/* cft/css accessors for cftype->write() operation */
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 44c6bd201d3a..8639f6b28746 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -148,7 +148,7 @@ static int hwpoison_filter_task(struct page *p)
ino = cgroup_ino(css->cgroup);
css_put(css);
- if (!ino || ino != hwpoison_filter_memcg)
+ if (ino != hwpoison_filter_memcg)
return -EINVAL;
return 0;