Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fab358d authored by Chen Gang's avatar Chen Gang Committed by Linus Torvalds
Browse files

include/linux/hugetlb*.h: clean up code



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: default avatarChen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a4a921aa
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -353,9 +353,7 @@ extern unsigned int default_hstate_idx;


static inline struct hstate *hstate_inode(struct inode *i)
static inline struct hstate *hstate_inode(struct inode *i)
{
{
	struct hugetlbfs_sb_info *hsb;
	return HUGETLBFS_SB(i->i_sb)->hstate;
	hsb = HUGETLBFS_SB(i->i_sb);
	return hsb->hstate;
}
}


static inline struct hstate *hstate_file(struct file *f)
static inline struct hstate *hstate_file(struct file *f)
+0 −4
Original line number Original line Diff line number Diff line
@@ -93,20 +93,17 @@ hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
			     struct hugetlb_cgroup *h_cg,
			     struct hugetlb_cgroup *h_cg,
			     struct page *page)
			     struct page *page)
{
{
	return;
}
}


static inline void
static inline void
hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages, struct page *page)
hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages, struct page *page)
{
{
	return;
}
}


static inline void
static inline void
hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
			       struct hugetlb_cgroup *h_cg)
			       struct hugetlb_cgroup *h_cg)
{
{
	return;
}
}


static inline void hugetlb_cgroup_file_init(void)
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,
static inline void hugetlb_cgroup_migrate(struct page *oldhpage,
					  struct page *newhpage)
					  struct page *newhpage)
{
{
	return;
}
}


#endif  /* CONFIG_MEM_RES_CTLR_HUGETLB */
#endif  /* CONFIG_MEM_RES_CTLR_HUGETLB */