From 33cd47dcbba068850eb73f00cc41090ba26c1e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= Date: Tue, 10 Apr 2018 16:28:54 -0700 Subject: mm/hmm: move hmm_pfns_clear() closer to where it is used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/20180323005527.758-13-jglisse@redhat.com Signed-off-by: Jérôme Glisse Reviewed-by: John Hubbard Cc: Evgeny Baskakov Cc: Ralph Campbell Cc: Mark Hairgrove Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/hmm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'mm/hmm.c') diff --git a/mm/hmm.c b/mm/hmm.c index c287fbbbf088..05b49a5d6674 100644 --- 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; -- cgit v1.2.3