[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1460296891-27673-1-git-send-email-chengang@emindsoft.com.cn>
Date: Sun, 10 Apr 2016 22:01:31 +0800
From: chengang@...ndsoft.com.cn
To: akpm@...ux-foundation.org, n-horiguchi@...jp.nec.com,
mike.kravetz@...cle.com, hillf.zj@...baba-inc.com, mhocko@...e.com,
dingel@...ux.vnet.ibm.com, dwoods@...hip.co,
baiyaowei@...s.chinamobile.com, kirill.shutemov@...ux.intel.com,
aarcange@...hat.com, lizefan@...wei.com, tj@...nel.org,
trivial@...nel.org
Cc: linux-kernel@...r.kernel.org, Chen Gang <gang.chen.5i5j@...il.com>
Subject: [PATCH trivial] include : linux: hugetlb: Clean up code
From: Chen Gang <gang.chen.5i5j@...il.com>
Macro HUGETLBFS_SB is clearer enough, so one statement is clearer than
3 lines statements.
Remove redundant return statements for non-return functions, which can
save lines, at least.
Signed-off-by: Chen Gang <gang.chen.5i5j@...il.com>
---
include/linux/hugetlb.h | 4 +---
include/linux/hugetlb_cgroup.h | 4 ----
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 0f735ea..c26d463 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -353,9 +353,7 @@ extern unsigned int default_hstate_idx;
static inline struct hstate *hstate_inode(struct inode *i)
{
- struct hugetlbfs_sb_info *hsb;
- hsb = HUGETLBFS_SB(i->i_sb);
- return hsb->hstate;
+ return HUGETLBFS_SB(i->i_sb)->hstate;
}
static inline struct hstate *hstate_file(struct file *f)
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h
index 24154c2..063962f 100644
--- a/include/linux/hugetlb_cgroup.h
+++ b/include/linux/hugetlb_cgroup.h
@@ -93,20 +93,17 @@ hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
struct hugetlb_cgroup *h_cg,
struct page *page)
{
- return;
}
static inline void
hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages, struct page *page)
{
- return;
}
static inline void
hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
struct hugetlb_cgroup *h_cg)
{
- return;
}
static inline void hugetlb_cgroup_file_init(void)
@@ -116,7 +113,6 @@ static inline void hugetlb_cgroup_file_init(void)
static inline void hugetlb_cgroup_migrate(struct page *oldhpage,
struct page *newhpage)
{
- return;
}
#endif /* CONFIG_MEM_RES_CTLR_HUGETLB */
--
1.9.3
Powered by blists - more mailing lists