From 0b59c33a407137ca2298556fa873be1128884957 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 28 Sep 2012 10:19:02 +1000 Subject: [PATCH] mm/memory.c: squash unused variable warning CONFIG_NUMA=n: mm/memory.c: In function 'do_prot_none': mm/memory.c:3447: warning: unused variable 'node' Fix this by eliminiating a rather gratuitous goto, and nuke a second gratuitous goto while we're there. Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Andrew Morton --- mm/memory.c | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index d896a2438eae..95dfbb4c5837 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3444,7 +3444,6 @@ static int do_prot_none(struct mm_struct *mm, struct vm_area_struct *vma, { struct page *page = NULL; spinlock_t *ptl; - int node; ptl = pte_lockptr(mm, pmd); spin_lock(ptl); @@ -3457,35 +3456,32 @@ static int do_prot_none(struct mm_struct *mm, struct vm_area_struct *vma, * lazy page migration, see MPOL_MF_LAZY and related. */ page = vm_normal_page(vma, address, entry); - if (!page) - goto do_fixup_locked; - - get_page(page); - pte_unmap_unlock(ptep, ptl); + if (page) { + int node; - node = mpol_misplaced(page, vma, address); - if (node == -1) - goto do_fixup; + get_page(page); + pte_unmap_unlock(ptep, ptl); - /* - * Page migration will install a new pte with vma->vm_page_prot, - * otherwise fall-through to the fixup. Next time,.. perhaps. - */ - if (!migrate_misplaced_page(mm, page, node)) { - put_page(page); - return 0; + node = mpol_misplaced(page, vma, address); + if (node != -1) { + /* + * Page migration will install a new pte with + * vma->vm_page_prot, otherwise fall-through to the + * fixup. Next time,.. perhaps. + */ + if (!migrate_misplaced_page(mm, page, node)) { + put_page(page); + return 0; + } + } + /* + * OK, nothing to do,.. change the protection back to what it + * ought to be. + */ + ptep = pte_offset_map_lock(mm, pmd, address, &ptl); + if (unlikely(!pte_same(*ptep, entry))) + goto unlock; } - -do_fixup: - /* - * OK, nothing to do,.. change the protection back to what it - * ought to be. - */ - ptep = pte_offset_map_lock(mm, pmd, address, &ptl); - if (unlikely(!pte_same(*ptep, entry))) - goto unlock; - -do_fixup_locked: #endif /* CONFIG_NUMA */ flush_cache_page(vma, address, pte_pfn(entry)); -- 2.39.5