Re: [PATCH] mm/huge_memory.c: Make __thp_get_unmapped_area static

From: Michal Hocko
Date: Sat May 04 2019 - 07:55:25 EST


On Sat 04-05-19 15:53:54, Bharath Vedartham wrote:
> __thp_get_unmapped_area is only used in mm/huge_memory.c. Make it
> static.

Makes sense. Looks like an omission.

> Tested by building and booting the kernel.

Testing by git grep __thp_get_unmapped_area would give you a better
picture. Build test migh not hit paths that are config specific and
static aspect of a functions should not have any functionality related
side effects AFAICS.

> Signed-off-by: Bharath Vedartham <linux.bhar@xxxxxxxxx>

Acked-by: Michal Hocko <mhocko@xxxxxxxx>

> ---
> mm/huge_memory.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 165ea46..75fe2b7 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -509,7 +509,7 @@ void prep_transhuge_page(struct page *page)
> set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
> }
>
> -unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len,
> +static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len,
> loff_t off, unsigned long flags, unsigned long size)
> {
> unsigned long addr;
> --
> 2.7.4
>

--
Michal Hocko
SUSE Labs