mm/hmm: move hmm_pfns_clear() closer to where it is used
authorJérôme Glisse <[email protected]>
Tue, 10 Apr 2018 23:28:54 +0000 (16:28 -0700)
committerLinus Torvalds <[email protected]>
Wed, 11 Apr 2018 17:28:30 +0000 (10:28 -0700)
Move hmm_pfns_clear() closer to where it is used to make it clear it is
not use by page table walkers.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jérôme Glisse <[email protected]>
Reviewed-by: John Hubbard <[email protected]>
Cc: Evgeny Baskakov <[email protected]>
Cc: Ralph Campbell <[email protected]>
Cc: Mark Hairgrove <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/hmm.c

index c287fbbbf088a296108785352446a12145e0f2c4..05b49a5d667466ab40ca525e7ae61f726b011321 100644 (file)
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -340,14 +340,6 @@ static int hmm_pfns_bad(unsigned long addr,
        return 0;
 }
 
-static void hmm_pfns_clear(uint64_t *pfns,
-                          unsigned long addr,
-                          unsigned long end)
-{
-       for (; addr < end; addr += PAGE_SIZE, pfns++)
-               *pfns = 0;
-}
-
 /*
  * hmm_vma_walk_hole() - handle a range lacking valid pmd or pte(s)
  * @start: range virtual start address (inclusive)
@@ -506,6 +498,14 @@ fault:
        return 0;
 }
 
+static void hmm_pfns_clear(uint64_t *pfns,
+                          unsigned long addr,
+                          unsigned long end)
+{
+       for (; addr < end; addr += PAGE_SIZE, pfns++)
+               *pfns = 0;
+}
+
 static void hmm_pfns_special(struct hmm_range *range)
 {
        unsigned long addr = range->start, i = 0;