Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/mm: Fix stupid bug in subpge protection handling

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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

David Gibson and committed by
Benjamin Herrenschmidt
a1128f8f c3a66359

+2 -2
+2 -2
arch/powerpc/mm/hash_utils_64.c
··· 879 879 */ 880 880 int hash_page(unsigned long ea, unsigned long access, unsigned long trap) 881 881 { 882 - void *pgdir; 882 + pgd_t *pgdir; 883 883 unsigned long vsid; 884 884 struct mm_struct *mm; 885 885 pte_t *ptep; ··· 1025 1025 else 1026 1026 #endif /* CONFIG_PPC_HAS_HASH_64K */ 1027 1027 { 1028 - int spp = subpage_protection(pgdir, ea); 1028 + int spp = subpage_protection(mm, ea); 1029 1029 if (access & spp) 1030 1030 rc = -2; 1031 1031 else