Skip to content

Commit

Permalink
mm/migrate.c: clean up useless code in migrate_vma_collect_pmd()
Browse files Browse the repository at this point in the history
Remove unused 'pfn' variable.

Link: http://lkml.kernel.org/r/1565167272-21453-1-git-send-email-kernelfans@gmail.com
Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Jan Kara <jack@suse.cz>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Pingfan Liu authored and Linus Torvalds committed Sep 24, 2019
1 parent f60858f commit 276f756
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2218,17 +2218,15 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp,
pte_t pte;

pte = *ptep;
pfn = pte_pfn(pte);

if (pte_none(pte)) {
mpfn = MIGRATE_PFN_MIGRATE;
migrate->cpages++;
pfn = 0;
goto next;
}

if (!pte_present(pte)) {
mpfn = pfn = 0;
mpfn = 0;

/*
* Only care about unaddressable device page special
Expand All @@ -2245,10 +2243,10 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp,
if (is_write_device_private_entry(entry))
mpfn |= MIGRATE_PFN_WRITE;
} else {
pfn = pte_pfn(pte);
if (is_zero_pfn(pfn)) {
mpfn = MIGRATE_PFN_MIGRATE;
migrate->cpages++;
pfn = 0;
goto next;
}
page = vm_normal_page(migrate->vma, addr, pte);
Expand All @@ -2258,10 +2256,9 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp,

/* FIXME support THP */
if (!page || !page->mapping || PageTransCompound(page)) {
mpfn = pfn = 0;
mpfn = 0;
goto next;
}
pfn = page_to_pfn(page);

/*
* By getting a reference on the page we pin it and that blocks
Expand Down

0 comments on commit 276f756

Please sign in to comment.