include/linux/hugetlb*.h: clean up code
authorChen Gang <gang.chen.5i5j@gmail.com>
Fri, 20 May 2016 23:57:59 +0000 (16:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 May 2016 00:58:30 +0000 (17:58 -0700)
Macro HUGETLBFS_SB is clear 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@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/hugetlb.h
include/linux/hugetlb_cgroup.h

index e44c57876e8994660596ae794c52c002ca78dc75..7ef4b635015db6ef4f8c0f90b6bf5e6569379d64 100644 (file)
@@ -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)
index 24154c26d469c60984020b5a0441fcb6dde3fcb0..063962f6dfc6acf2c5981027b17a017d23911bdf 100644 (file)
@@ -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 */