Subject: Re: [PATCH v3 10/31] powerpc/mm: Don't use pmd_val,pud_val and pgd_val as lvalue

From: Michael Ellerman <[email-masked]>
Date: Tue, 13 Oct 2015 20:26:58 +1100

On Tue, 2015-10-13 at 10:53 +0530, Aneesh Kumar K.V wrote:
> Michael Ellerman <[email-masked]> writes:
> 
> > On Tue, 2015-10-13 at 00:09 +0530, Aneesh Kumar K.V wrote:
> >> We convert them static inline function here as we did with pte_val in
> >> the previous patch
> >
> > This breaks ppc40x_defconfig & 40x/ep405_defconfig with:
> 
> How about
> 
> diff --git a/arch/powerpc/mm/40x_mmu.c b/arch/powerpc/mm/40x_mmu.c
> index 5810967511d4..31a5d42df8c9 100644
> --- a/arch/powerpc/mm/40x_mmu.c
> +++ b/arch/powerpc/mm/40x_mmu.c
> @@ -110,10 +110,10 @@ unsigned long __init mmu_mapin_ram(unsigned long top)
>  		unsigned long val = p | _PMD_SIZE_16M | _PAGE_EXEC | _PAGE_HWWRITE;
>  
>  		pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
> -		pmd_val(*pmdp++) = val;
> -		pmd_val(*pmdp++) = val;
> -		pmd_val(*pmdp++) = val;
> -		pmd_val(*pmdp++) = val;
> +		*pmdp++ = __pmd(val);
> +		*pmdp++ = __pmd(val);
> +		*pmdp++ = __pmd(val);
> +		*pmdp++ = __pmd(val);
>  
>  		v += LARGE_PAGE_SIZE_16M;
>  		p += LARGE_PAGE_SIZE_16M;
> @@ -125,7 +125,7 @@ unsigned long __init mmu_mapin_ram(unsigned long top)
>  		unsigned long val = p | _PMD_SIZE_4M | _PAGE_EXEC | _PAGE_HWWRITE;
>  
>  		pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
> -		pmd_val(*pmdp) = val;
> +		*pmdp = __pmd(val);

Yep that fixes it, I've squashed that in for now to get it building.

cheers