Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422789Ab3FUA3c (ORCPT ); Thu, 20 Jun 2013 20:29:32 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:40570 "EHLO e28smtp03.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422750Ab3FUA3Q (ORCPT ); Thu, 20 Jun 2013 20:29:16 -0400 From: Wanpeng Li To: Andrew Morton Cc: Michal Hocko , David Rientjes , "Kirill A. Shutemov" , Fengguang Wu , Rik van Riel , Andrew Shewmaker , Jiri Kosina , Namjae Jeon , Jan Kara , Tejun Heo , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH v5 6/6] mm/pgtable: Don't accumulate addr during pgd prepopulate pmd Date: Fri, 21 Jun 2013 08:28:54 +0800 Message-Id: <1371774534-4139-6-git-send-email-liwanp@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1371774534-4139-1-git-send-email-liwanp@linux.vnet.ibm.com> References: <1371774534-4139-1-git-send-email-liwanp@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13062100-3864-0000-0000-000008BB3597 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1452 Lines: 42 The old codes accumulate addr to get right pmd, however, currently pmds are preallocated and transfered as a parameter, there is unnecessary to accumulate addr variable any more, this patch remove it. Reviewed-by: Michal Hocko Reviewed-by: Zhang Yanfei Signed-off-by: Wanpeng Li --- arch/x86/mm/pgtable.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 17fda6a..dfa537a 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -240,7 +240,6 @@ static void pgd_mop_up_pmds(struct mm_struct *mm, pgd_t *pgdp) static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[]) { pud_t *pud; - unsigned long addr; int i; if (PREALLOCATED_PMDS == 0) /* Work around gcc-3.4.x bug */ @@ -248,8 +247,7 @@ static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[]) pud = pud_offset(pgd, 0); - for (addr = i = 0; i < PREALLOCATED_PMDS; - i++, pud++, addr += PUD_SIZE) { + for (i = 0; i < PREALLOCATED_PMDS; i++, pud++) { pmd_t *pmd = pmds[i]; if (i >= KERNEL_PGD_BOUNDARY) -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/