diff mbox

Fix stupid bug in subpge protection handling

Message ID 20091217002956.GQ9463@yookeroo (mailing list archive)
State Accepted, archived
Commit a1128f8f0ff06ccbea5d6b4a69446b506c57bfbc
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

David Gibson Dec. 17, 2009, 12:29 a.m. UTC
Commit d28513bc7f675d28b479db666d572e078ecf182d ("Fix bug in pagetable
cache cleanup with CONFIG_PPC_SUBPAGE_PROT"), itself a fix for
breakage caused by an earlier clean up patch of mine, contains a
stupid bug.  I changed the parameters of the subpage_protection()
function, but failed to update one of the callers.

This patch fixes it, and replaces a void * with a typed pointer so
that the compiler will warn on such an error in future.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
diff mbox

Patch

Index: working-2.6/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- working-2.6.orig/arch/powerpc/mm/hash_utils_64.c	2009-12-16 11:43:51.357324268 +1100
+++ working-2.6/arch/powerpc/mm/hash_utils_64.c	2009-12-16 11:44:35.473351990 +1100
@@ -879,7 +879,7 @@  static inline int subpage_protection(str
  */
 int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
 {
-	void *pgdir;
+	pgd_t *pgdir;
 	unsigned long vsid;
 	struct mm_struct *mm;
 	pte_t *ptep;
@@ -1025,7 +1025,7 @@  int hash_page(unsigned long ea, unsigned
 	else
 #endif /* CONFIG_PPC_HAS_HASH_64K */
 	{
-		int spp = subpage_protection(pgdir, ea);
+		int spp = subpage_protection(mm, ea);
 		if (access & spp)
 			rc = -2;
 		else