From: Arnd Bergmann <arnd@arndb.de>
To: Andrew Morton <akpm@linux-foundation.org>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Mike Kravetz <mike.kravetz@oracle.com>,
Michal Hocko <mhocko@suse.com>,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
Andrea Arcangeli <aarcange@redhat.com>,
zhong jiang <zhongjiang@huawei.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] mm: hugepage: make hstate_is_gigantic() inline
Date: Mon, 22 May 2017 14:46:57 +0200 [thread overview]
Message-ID: <20170522124748.3911296-1-arnd@arndb.de> (raw)
Ignoring the argument of both alloc_huge_page_node() and hstate_is_gigantic()
causes a harmless warning:
mm/memory-failure.c: In function 'new_page':
mm/memory-failure.c:1493:18: error: unused variable 'hstate' [-Werror=unused-variable]
Turning one into an inline function makes the compiler see that the variable is
not meant to be unused.
Fixes: d81a077951f8 ("mm/madvise: enable (soft|hard) offline of HugeTLB pages at PGD level")
Fixes: 39b80148ffd7 ("mm/follow_page_mask: add support for hugepage directory entry")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/hugetlb.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 76b9ddcd8c3c..c92a1f0c7240 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -532,7 +532,11 @@ struct hstate {};
#define vma_mmu_pagesize(v) PAGE_SIZE
#define huge_page_order(h) 0
#define huge_page_shift(h) PAGE_SHIFT
-#define hstate_is_gigantic(h) 0
+static inline bool hstate_is_gigantic(struct hstate *h)
+{
+ return false;
+}
+
static inline unsigned int pages_per_huge_page(struct hstate *h)
{
return 1;
--
2.9.0
next reply other threads:[~2017-05-22 12:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 12:46 Arnd Bergmann [this message]
2017-05-22 12:56 ` [PATCH] mm: hugepage: make hstate_is_gigantic() inline Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170522124748.3911296-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=khandual@linux.vnet.ibm.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=zhongjiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).