summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-08-06 19:05:50 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-08-07 14:58:06 -0300
commit251bbe59b7a6362f4c417aa8af281d44f9edfa0e (patch)
tree7ea191249eb537fb6d565cb2804804aa281bb660
parent9d3973d60f0abd3985229bd895f45e2b8974344c (diff)
downloadlinux-251bbe59b7a6362f4c417aa8af281d44f9edfa0e.tar.bz2
mm/hmm: cleanup the hmm_vma_walk_hugetlb_entry stub
Stub out the whole function and assign NULL to the .hugetlb_entry method if CONFIG_HUGETLB_PAGE is not set, as the method won't ever be called in that case. Link: https://lore.kernel.org/r/20190806160554.14046-13-hch@lst.de Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--mm/hmm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/hmm.c b/mm/hmm.c
index 900cb4837315..ef553e664061 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -774,11 +774,11 @@ again:
#define hmm_vma_walk_pud NULL
#endif
+#ifdef CONFIG_HUGETLB_PAGE
static int hmm_vma_walk_hugetlb_entry(pte_t *pte, unsigned long hmask,
unsigned long start, unsigned long end,
struct mm_walk *walk)
{
-#ifdef CONFIG_HUGETLB_PAGE
unsigned long addr = start, i, pfn;
struct hmm_vma_walk *hmm_vma_walk = walk->private;
struct hmm_range *range = hmm_vma_walk->range;
@@ -817,10 +817,10 @@ unlock:
return hmm_vma_walk_hole_(addr, end, fault, write_fault, walk);
return ret;
-#else /* CONFIG_HUGETLB_PAGE */
- return -EINVAL;
-#endif
}
+#else
+#define hmm_vma_walk_hugetlb_entry NULL
+#endif /* CONFIG_HUGETLB_PAGE */
static void hmm_pfns_clear(struct hmm_range *range,
uint64_t *pfns,