[PATCH V5 11/31] powerpc/mm: Move hash64 PTE bits from book3s/64/pgtable.h to hash.h

Anshuman Khandual khandual at linux.vnet.ibm.com
Wed Nov 25 17:22:32 AEDT 2015


On 11/23/2015 03:52 PM, Aneesh Kumar K.V wrote:
> +extern struct page *pmd_page(pmd_t pmd);
>  static inline pte_t pud_pte(pud_t pud)
>  {
>  	return __pte(pud_val(pud));
> @@ -294,15 +115,14 @@ static inline void pgd_set(pgd_t *pgdp, unsigned long val)
>   * Find an entry in a page-table-directory.  We combine the address region
>   * (the high order N bits) and the pgd portion of the address.
>   */
> -#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1))
>  
>  #define pgd_offset(mm, address)	 ((mm)->pgd + pgd_index(address))
>  
>  #define pmd_offset(pudp,addr) \
> -  (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
> +	(((pmd_t *) pud_page_vaddr(*(pudp))) + pmd_index(addr))
>  
>  #define pte_offset_kernel(dir,addr) \
> -  (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
> +	(((pte_t *) pmd_page_vaddr(*(dir))) + pte_index(addr))

These additions of the code should have been done in a separate patch.

This has been observed in some of the previous patches as well. If the
commit message says that PTE definitions need to be moved then the
patch only needs to move them, not change them anyway while on the move.
Any changes to code should be done in separate patch. That will keep
the change log clean, logical and makes it easy to track and understand.

------------------------------------------------------------------------
powerpc/mm: Move hash64 PTE bits from book3s/64/pgtable.h to hash.h
    
This enables us to keep hash64 related bits together, and makes it easy
to follow.
    
Acked-by: Scott Wood <scottwood at freescale.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>

 arch/powerpc/include/asm/book3s/64/hash.h    | 450 ++++++++++++++++++
 arch/powerpc/include/asm/book3s/64/pgtable.h | 447 ------------------
 arch/powerpc/include/asm/pgtable.h           |   6 --
 3 files changed, 450 insertions(+), 453 deletions(-)





More information about the Linuxppc-dev mailing list