[patch 12/15] vmemmap: use clear_table to initialise page tables.

Previous thread: [patch 06/15] remove -traditional by Martin Schwidefsky on Tuesday, April 29, 2008 - 7:01 am. (1 message)

Next thread: [patch 07/15] cio: Make isc handling more robust. by Martin Schwidefsky on Tuesday, April 29, 2008 - 7:01 am. (1 message)
From: Martin Schwidefsky
Date: Tuesday, April 29, 2008 - 7:01 am

From: Heiko Carstens <heiko.carstens@de.ibm.com>

Always use clear_table to initialise page tables. The overlapping
memcpy is just a leftover of a previous version that wasn't fully
converted to clear_table.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 arch/s390/mm/vmem.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: quilt-2.6/arch/s390/mm/vmem.c
===================================================================
--- quilt-2.6.orig/arch/s390/mm/vmem.c
+++ quilt-2.6/arch/s390/mm/vmem.c
@@ -77,8 +77,7 @@ static inline pud_t *vmem_pud_alloc(void
 	pud = vmem_alloc_pages(2);
 	if (!pud)
 		return NULL;
-	pud_val(*pud) = _REGION3_ENTRY_EMPTY;
-	memcpy(pud + 1, pud, (PTRS_PER_PUD - 1)*sizeof(pud_t));
+	clear_table((unsigned long *) pud, _REGION3_ENTRY_EMPTY, PAGE_SIZE * 4);
 #endif
 	return pud;
 }
@@ -91,7 +90,7 @@ static inline pmd_t *vmem_pmd_alloc(void
 	pmd = vmem_alloc_pages(2);
 	if (!pmd)
 		return NULL;
-	clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE*4);
+	clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE * 4);
 #endif
 	return pmd;
 }

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--

Previous thread: [patch 06/15] remove -traditional by Martin Schwidefsky on Tuesday, April 29, 2008 - 7:01 am. (1 message)

Next thread: [patch 07/15] cio: Make isc handling more robust. by Martin Schwidefsky on Tuesday, April 29, 2008 - 7:01 am. (1 message)