summaryrefslogtreecommitdiff
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 31451af257dd..b1494dcfd063 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -190,10 +190,10 @@ static inline void clear_pgd_range(struct mmu_gather *tlb, pgd_t *pgd, unsigned
void clear_page_range(struct mmu_gather *tlb, unsigned long start, unsigned long end)
{
unsigned long addr = start, next;
- unsigned long i, nr = pgd_index(end + PGDIR_SIZE-1) - pgd_index(start);
pgd_t * pgd = pgd_offset(tlb->mm, start);
+ unsigned long i;
- for (i = 0; i < nr; i++) {
+ for (i = pgd_index(start); i <= pgd_index(end-1); i++) {
next = (addr + PGDIR_SIZE) & PGDIR_MASK;
if (next > end || next <= addr)
next = end;