Patch from Dave Hansen <haveblue@us.ibm.com>

Same thing as the __pgd_offset one, just for pmds this time to keep the
naming consistent.



 25-akpm/arch/i386/mm/init.c               |   12 ++++++------
 25-akpm/arch/um/kernel/mem.c              |    2 +-
 25-akpm/include/asm-i386/pgtable-3level.h |    2 +-
 25-akpm/include/asm-i386/pgtable.h        |    2 +-
 25-akpm/include/asm-s390x/pgtable.h       |    4 ++--
 25-akpm/include/asm-um/pgtable.h          |    2 +-
 25-akpm/include/asm-x86_64/pgtable.h      |    4 ++--
 7 files changed, 14 insertions(+), 14 deletions(-)

diff -puN arch/i386/mm/init.c~remove-__pmd_offset arch/i386/mm/init.c
--- 25/arch/i386/mm/init.c~remove-__pmd_offset	Tue Mar  4 15:03:07 2003
+++ 25-akpm/arch/i386/mm/init.c	Tue Mar  4 15:03:07 2003
@@ -98,12 +98,12 @@ static void __init page_table_range_init
 {
 	pgd_t *pgd;
 	pmd_t *pmd;
-	int pgd_idx, pmd_ofs;
+	int pgd_idx, pmd_idx;
 	unsigned long vaddr;
 
 	vaddr = start;
 	pgd_idx = pgd_index(vaddr);
-	pmd_ofs = __pmd_offset(vaddr);
+	pmd_idx = pmd_index(vaddr);
 	pgd = pgd_base + pgd_idx;
 
 	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd++, pgd_idx++) {
@@ -111,13 +111,13 @@ static void __init page_table_range_init
 			one_md_table_init(pgd);
 
 		pmd = pmd_offset(pgd, vaddr);
-		for (; (pmd_ofs < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_ofs++) {
+		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_idx++) {
 			if (pmd_none(*pmd)) 
 				one_page_table_init(pmd);
 
 			vaddr += PMD_SIZE;
 		}
-		pmd_ofs = 0;
+		pmd_idx = 0;
 	}
 }
 
@@ -132,7 +132,7 @@ static void __init kernel_physical_mappi
 	pgd_t *pgd;
 	pmd_t *pmd;
 	pte_t *pte;
-	int pgd_idx, pmd_ofs, pte_ofs;
+	int pgd_idx, pmd_idx, pte_ofs;
 
 	pgd_idx = pgd_index(PAGE_OFFSET);
 	pgd = pgd_base + pgd_idx;
@@ -142,7 +142,7 @@ static void __init kernel_physical_mappi
 		pmd = one_md_table_init(pgd);
 		if (pfn >= max_low_pfn)
 			continue;
-		for (pmd_ofs = 0; pmd_ofs < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_ofs++) {
+		for (pmd_idx = 0; pmd_idx < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_idx++) {
 			/* Map with big pages if possible, otherwise create normal page tables. */
 			if (cpu_has_pse) {
 				set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE));
diff -puN arch/um/kernel/mem.c~remove-__pmd_offset arch/um/kernel/mem.c
--- 25/arch/um/kernel/mem.c~remove-__pmd_offset	Tue Mar  4 15:03:07 2003
+++ 25-akpm/arch/um/kernel/mem.c	Tue Mar  4 15:03:07 2003
@@ -155,7 +155,7 @@ static void __init fixrange_init(unsigne
 
 	vaddr = start;
 	i = pgd_index(vaddr);
-	j = __pmd_offset(vaddr);
+	j = pmd_index(vaddr);
 	pgd = pgd_base + i;
 
 	for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) {
diff -puN include/asm-i386/pgtable-3level.h~remove-__pmd_offset include/asm-i386/pgtable-3level.h
--- 25/include/asm-i386/pgtable-3level.h~remove-__pmd_offset	Tue Mar  4 15:03:07 2003
+++ 25-akpm/include/asm-i386/pgtable-3level.h	Tue Mar  4 15:03:07 2003
@@ -69,7 +69,7 @@ static inline void pgd_clear (pgd_t * pg
 
 /* Find an entry in the second-level page table.. */
 #define pmd_offset(dir, address) ((pmd_t *) pgd_page(*(dir)) + \
-			__pmd_offset(address))
+			pmd_index(address))
 
 static inline pte_t ptep_get_and_clear(pte_t *ptep)
 {
diff -puN include/asm-i386/pgtable.h~remove-__pmd_offset include/asm-i386/pgtable.h
--- 25/include/asm-i386/pgtable.h~remove-__pmd_offset	Tue Mar  4 15:03:07 2003
+++ 25-akpm/include/asm-i386/pgtable.h	Tue Mar  4 15:03:07 2003
@@ -243,7 +243,7 @@ static inline pte_t pte_modify(pte_t pte
 /* to find an entry in a kernel page-table-directory */
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
-#define __pmd_offset(address) \
+#define pmd_index(address) \
 		(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
 /* Find an entry in the third-level page table.. */
diff -puN include/asm-s390x/pgtable.h~remove-__pmd_offset include/asm-s390x/pgtable.h
--- 25/include/asm-s390x/pgtable.h~remove-__pmd_offset	Tue Mar  4 15:03:07 2003
+++ 25-akpm/include/asm-s390x/pgtable.h	Tue Mar  4 15:03:07 2003
@@ -488,9 +488,9 @@ extern inline pte_t mk_pte_phys(unsigned
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
 /* Find an entry in the second-level page table.. */
-#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
+#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 #define pmd_offset(dir,addr) \
-	((pmd_t *) pgd_page_kernel(*(dir)) + __pmd_offset(addr))
+	((pmd_t *) pgd_page_kernel(*(dir)) + pmd_index(addr))
 
 /* Find an entry in the third-level page table.. */
 #define __pte_offset(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
diff -puN include/asm-um/pgtable.h~remove-__pmd_offset include/asm-um/pgtable.h
--- 25/include/asm-um/pgtable.h~remove-__pmd_offset	Tue Mar  4 15:03:07 2003
+++ 25-akpm/include/asm-um/pgtable.h	Tue Mar  4 15:03:07 2003
@@ -365,7 +365,7 @@ static inline pte_t pte_modify(pte_t pte
 /* to find an entry in a kernel page-table-directory */
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
-#define __pmd_offset(address) \
+#define pmd_index(address) \
 		(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
 /* Find an entry in the second-level page table.. */
diff -puN include/asm-x86_64/pgtable.h~remove-__pmd_offset include/asm-x86_64/pgtable.h
--- 25/include/asm-x86_64/pgtable.h~remove-__pmd_offset	Tue Mar  4 15:03:07 2003
+++ 25-akpm/include/asm-x86_64/pgtable.h	Tue Mar  4 15:03:07 2003
@@ -321,9 +321,9 @@ static inline pgd_t *current_pgd_offset_
 #define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK))
 #define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
 
-#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
+#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 #define pmd_offset(dir, address) ((pmd_t *) pgd_page(*(dir)) + \
-			__pmd_offset(address))
+			pmd_index(address))
 #define pmd_none(x)	(!pmd_val(x))
 #define pmd_present(x)	(pmd_val(x) & _PAGE_PRESENT)
 #define pmd_clear(xp)	do { set_pmd(xp, __pmd(0)); } while (0)

_