From: akpm@linux-foundation.org Subject: [patch 032/162] include/linux/hugetlb*.h: clean up code Date: Fri, 20 May 2016 16:57:59 -0700 Message-ID: <573fa487.gHiOu8aK53O4JYQq%akpm@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:52296 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751593AbcETX6A (ORCPT ); Fri, 20 May 2016 19:58:00 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: torvalds@linux-foundation.org, mm-commits@vger.kernel.org, akpm@linux-foundation.org, gang.chen.5i5j@gmail.com From: Chen Gang Subject: 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: Chen Gang Signed-off-by: Andrew Morton --- include/linux/hugetlb.h | 4 +--- include/linux/hugetlb_cgroup.h | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff -puN include/linux/hugetlb.h~include-linux-hugetlb-clean-up-code include/linux/hugetlb.h --- a/include/linux/hugetlb.h~include-linux-hugetlb-clean-up-code +++ a/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 -puN include/linux/hugetlb_cgroup.h~include-linux-hugetlb-clean-up-code include/linux/hugetlb_cgroup.h --- a/include/linux/hugetlb_cgroup.h~include-linux-hugetlb-clean-up-code +++ a/include/linux/hugetlb_cgroup.h @@ -93,20 +93,17 @@ hugetlb_cgroup_commit_charge(int idx, un 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_i static inline void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage) { - return; } #endif /* CONFIG_MEM_RES_CTLR_HUGETLB */ _