Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73b44ff4 authored by Wanpeng Li's avatar Wanpeng Li Committed by Linus Torvalds
Browse files

mm/pgtable: don't accumulate addr during pgd prepopulate pmd



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.

Signed-off-by: default avatarWanpeng Li <liwanp@linux.vnet.ibm.com>
Reviewed-by: default avatarMichal Hocko <mhocko@suse.cz>
Reviewed-by: default avatarZhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f49cbdde
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -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[])
static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[])
{
{
	pud_t *pud;
	pud_t *pud;
	unsigned long addr;
	int i;
	int i;


	if (PREALLOCATED_PMDS == 0) /* Work around gcc-3.4.x bug */
	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);
	pud = pud_offset(pgd, 0);


 	for (addr = i = 0; i < PREALLOCATED_PMDS;
	for (i = 0; i < PREALLOCATED_PMDS; i++, pud++) {
	     i++, pud++, addr += PUD_SIZE) {
		pmd_t *pmd = pmds[i];
		pmd_t *pmd = pmds[i];


		if (i >= KERNEL_PGD_BOUNDARY)
		if (i >= KERNEL_PGD_BOUNDARY)