X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=mm%2Fpagewalk.c;h=0afd2387e507d8f8deed9697f1971fc953f4b4b6;hb=831d991821daedd4839073dbca55514432ef1768;hp=b4f27d22da916e44372111a88c1da5f1bc2b82f6;hpb=a29961b33b089cf4d252ac125891a2784d20ef2f;p=mv-sheeva.git diff --git a/mm/pagewalk.c b/mm/pagewalk.c index b4f27d22da9..0afd2387e50 100644 --- a/mm/pagewalk.c +++ b/mm/pagewalk.c @@ -9,11 +9,15 @@ static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, int err = 0; pte = pte_offset_map(pmd, addr); - do { + for (;;) { err = walk->pte_entry(pte, addr, addr + PAGE_SIZE, private); if (err) break; - } while (pte++, addr += PAGE_SIZE, addr != end); + addr += PAGE_SIZE; + if (addr == end) + break; + pte++; + } pte_unmap(pte); return err; @@ -77,11 +81,11 @@ static int walk_pud_range(pgd_t *pgd, unsigned long addr, unsigned long end, /** * walk_page_range - walk a memory map's page tables with a callback - * @mm - memory map to walk - * @addr - starting address - * @end - ending address - * @walk - set of callbacks to invoke for each level of the tree - * @private - private data passed to the callback function + * @mm: memory map to walk + * @addr: starting address + * @end: ending address + * @walk: set of callbacks to invoke for each level of the tree + * @private: private data passed to the callback function * * Recursively walk the page table for the memory area in a VMA, * calling supplied callbacks. Callbacks are called in-order (first