Re: [PATCH 3/4] x86/mm: init_64: make set_pte_vaddr_p4d static
From: Edgecombe, Rick P
Date: Thu Nov 11 2021 - 15:48:16 EST
On Thu, 2021-11-11 at 13:02 +0200, Mike Rapoport wrote:
> From: Mike Rapoport <rppt@xxxxxxxxxxxxx>
>
> The function set_pte_vaddr_p4d() is never called outside the file
> arch/x86/mm/init_64.c.
>
> Make it static.
>
> Signed-off-by: Mike Rapoport <rppt@xxxxxxxxxxxxx>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
> ---
> arch/x86/include/asm/pgtable_64.h | 1 -
> arch/x86/mm/init_64.c | 3 ++-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/pgtable_64.h
> b/arch/x86/include/asm/pgtable_64.h
> index 56d0399a0cd1..9f4b6d48ce2b 100644
> --- a/arch/x86/include/asm/pgtable_64.h
> +++ b/arch/x86/include/asm/pgtable_64.h
> @@ -59,7 +59,6 @@ static inline bool mm_p4d_folded(struct mm_struct
> *mm)
> return !pgtable_l5_enabled();
> }
>
> -void set_pte_vaddr_p4d(p4d_t *p4d_page, unsigned long vaddr, pte_t
> new_pte);
> void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t
> new_pte);
>
> static inline void native_set_pte(pte_t *ptep, pte_t pte)
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 9a24532d2b85..e46d2f18d895 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -302,7 +302,8 @@ static void __set_pte_vaddr(pud_t *pud, unsigned
> long vaddr, pte_t new_pte)
> flush_tlb_one_kernel(vaddr);
> }
>
> -void set_pte_vaddr_p4d(p4d_t *p4d_page, unsigned long vaddr, pte_t
> new_pte)
> +static void set_pte_vaddr_p4d(p4d_t *p4d_page, unsigned long vaddr,
> + pte_t new_pte)
> {
> p4d_t *p4d = p4d_page + p4d_index(vaddr);
> pud_t *pud = fill_pud(p4d, vaddr);