linux-next: build failure after merge of the akpm-current tree

From: Stephen Rothwell
Date: Wed Apr 23 2014 - 00:17:41 EST


Hi Andrew,

After merging the akpm-current tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

In file included from arch/arm/mm/flush.c:20:0:
include/linux/hugetlb.h: In function 'hugepages_supported':
include/linux/hugetlb.h:468:9: error: 'HPAGE_SHIFT' undeclared (first use in this function)

And a few more similarly.

Caused by commit c669debfbf05 ("hugetlb: ensure hugepage access is denied
if hugepages are not supported").

I added the following fix patch:

From 91e29eff2be1b6bc0c9ea33b1ee901dd4877e924 Mon Sep 17 00:00:00 2001
From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Date: Wed, 23 Apr 2014 14:12:56 +1000
Subject: [PATCH] hugetlb: ensure hugepage access is denied if hugepages are
not supported -fix

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---
include/linux/hugetlb.h | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 4eace5e94117..cbee9847e425 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -214,6 +214,15 @@ static inline int is_file_hugepages(struct file *file)
return 0;
}

+static inline bool hugepages_supported(void)
+{
+ /*
+ * Some platform decide whether they support huge pages at boot
+ * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when
+ * there is no such support
+ */
+ return HPAGE_SHIFT != 0;
+}

#else /* !CONFIG_HUGETLBFS */

@@ -458,14 +467,4 @@ static inline spinlock_t *huge_pte_lock(struct hstate *h,
return ptl;
}

-static inline bool hugepages_supported(void)
-{
- /*
- * Some platform decide whether they support huge pages at boot
- * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when
- * there is no such support
- */
- return HPAGE_SHIFT != 0;
-}
-
#endif /* _LINUX_HUGETLB_H */
--
1.9.2

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/

Attachment: pgpI2NMscsXMc.pgp
Description: PGP signature