Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035AbdFKXvi convert rfc822-to-8bit (ORCPT ); Sun, 11 Jun 2017 19:51:38 -0400 Received: from tyo161.gate.nec.co.jp ([114.179.232.161]:33990 "EHLO tyo161.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751936AbdFKXvg (ORCPT ); Sun, 11 Jun 2017 19:51:36 -0400 From: Naoya Horiguchi To: Arnd Bergmann CC: Andrew Morton , "Aneesh Kumar K.V" , Punit Agrawal , Anshuman Khandual , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mm: hugetlb: replace some macros with inline functions Thread-Topic: [PATCH] mm: hugetlb: replace some macros with inline functions Thread-Index: AQHS4QrI4TQVUqWmrUiL9zDK7+MZv6IfwfWA Date: Sun, 11 Jun 2017 23:50:09 +0000 Message-ID: <20170611235009.GA4959@hori1.linux.bs1.fc.nec.co.jp> References: <20170609102544.2947326-1-arnd@arndb.de> In-Reply-To: <20170609102544.2947326-1-arnd@arndb.de> Accept-Language: en-US, ja-JP Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.13] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <281913F7882C3D41987F9E392DE36309@gisp.nec.co.jp> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2092 Lines: 73 On Fri, Jun 09, 2017 at 12:25:05PM +0200, Arnd Bergmann wrote: > All users of dissolve_free_huge_page() that ignore the result cause a warning > when CONFIG_HUGETLB_PAGE is disabled: > > mm/memory-failure.c: In function 'me_huge_page': > include/linux/hugetlb.h:556:36: error: statement with no effect [-Werror=unused-value] > #define dissolve_free_huge_page(p) 0 > > We can avoid this by using an inline function instead of the macro, and I > decided to do the same change for the related helpers as well. > > Fixes: mmotm ("mm: hugetlb: soft-offline: dissolve source hugepage after successful migration") > Signed-off-by: Arnd Bergmann Right, thank you for catching this. Acked-by: Naoya Horiguchi > --- > include/linux/hugetlb.h | 31 ++++++++++++++++++++++++++----- > 1 file changed, 26 insertions(+), 5 deletions(-) > > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h > index dbb118c566cd..57f700ac127e 100644 > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -546,16 +546,37 @@ static inline unsigned int pages_per_huge_page(struct hstate *h) > { > return 1; > } > -#define hstate_index_to_shift(index) 0 > -#define hstate_index(h) 0 > + > +static inline unsigned hstate_index_to_shift(unsigned index) > +{ > + return 0; > +} > + > +static inline int hstate_index(struct hstate *h) > +{ > + return 0; > +} > > static inline pgoff_t basepage_index(struct page *page) > { > return page->index; > } > -#define dissolve_free_huge_page(p) 0 > -#define dissolve_free_huge_pages(s, e) 0 > -#define hugepage_migration_supported(h) false > + > +static inline int dissolve_free_huge_page(struct page *page) > +{ > + return 0; > +} > + > +static inline int dissolve_free_huge_pages(unsigned long start_pfn, > + unsigned long end_pfn) > +{ > + return 0; > +} > + > +static inline bool hugepage_migration_supported(struct hstate *h) > +{ > + return false; > +} > > static inline spinlock_t *huge_pte_lockptr(struct hstate *h, > struct mm_struct *mm, pte_t *pte) > -- > 2.9.0 > >