pa isn't needed in the uvmunmap() loop

This commit is contained in:
Robert Morris 2020-08-13 08:04:56 -04:00 committed by Frans Kaashoek
parent 56e7cebdb9
commit e283514ad0

View file

@ -175,7 +175,6 @@ uvmunmap(pagetable_t pagetable, uint64 va, uint64 size, int do_free)
{ {
uint64 a, last; uint64 a, last;
pte_t *pte; pte_t *pte;
uint64 pa;
a = PGROUNDDOWN(va); a = PGROUNDDOWN(va);
last = PGROUNDDOWN(va + size - 1); last = PGROUNDDOWN(va + size - 1);
@ -189,14 +188,13 @@ uvmunmap(pagetable_t pagetable, uint64 va, uint64 size, int do_free)
if(PTE_FLAGS(*pte) == PTE_V) if(PTE_FLAGS(*pte) == PTE_V)
panic("uvmunmap: not a leaf"); panic("uvmunmap: not a leaf");
if(do_free){ if(do_free){
pa = PTE2PA(*pte); uint64 pa = PTE2PA(*pte);
kfree((void*)pa); kfree((void*)pa);
} }
*pte = 0; *pte = 0;
if(a == last) if(a == last)
break; break;
a += PGSIZE; a += PGSIZE;
pa += PGSIZE;
} }
} }