Skip to content

Commit 41fd59b

Browse files
bibo-maodennisszhou
authored andcommitted
mm/percpu: Remove some local variables in pcpu_populate_pte
In function pcpu_populate_pte there are already variable defined, it can be reused for later use, here remove duplicated local variables. Signed-off-by: Bibo Mao <[email protected]> Signed-off-by: Dennis Zhou <[email protected]>
1 parent 5d0c230 commit 41fd59b

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

mm/percpu.c

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,32 +3189,26 @@ void __init __weak pcpu_populate_pte(unsigned long addr)
31893189
pmd_t *pmd;
31903190

31913191
if (pgd_none(*pgd)) {
3192-
p4d_t *new;
3193-
3194-
new = memblock_alloc(P4D_TABLE_SIZE, P4D_TABLE_SIZE);
3195-
if (!new)
3192+
p4d = memblock_alloc(P4D_TABLE_SIZE, P4D_TABLE_SIZE);
3193+
if (!p4d)
31963194
goto err_alloc;
3197-
pgd_populate(&init_mm, pgd, new);
3195+
pgd_populate(&init_mm, pgd, p4d);
31983196
}
31993197

32003198
p4d = p4d_offset(pgd, addr);
32013199
if (p4d_none(*p4d)) {
3202-
pud_t *new;
3203-
3204-
new = memblock_alloc(PUD_TABLE_SIZE, PUD_TABLE_SIZE);
3205-
if (!new)
3200+
pud = memblock_alloc(PUD_TABLE_SIZE, PUD_TABLE_SIZE);
3201+
if (!pud)
32063202
goto err_alloc;
3207-
p4d_populate(&init_mm, p4d, new);
3203+
p4d_populate(&init_mm, p4d, pud);
32083204
}
32093205

32103206
pud = pud_offset(p4d, addr);
32113207
if (pud_none(*pud)) {
3212-
pmd_t *new;
3213-
3214-
new = memblock_alloc(PMD_TABLE_SIZE, PMD_TABLE_SIZE);
3215-
if (!new)
3208+
pmd = memblock_alloc(PMD_TABLE_SIZE, PMD_TABLE_SIZE);
3209+
if (!pmd)
32163210
goto err_alloc;
3217-
pud_populate(&init_mm, pud, new);
3211+
pud_populate(&init_mm, pud, pmd);
32183212
}
32193213

32203214
pmd = pmd_offset(pud, addr);

0 commit comments

Comments
 (0)