diff mbox series

[2/3] mm: move two private functions to static linkage

Message ID 75cae66d92a074dbd62590a966d7005b187f4fe5.1543899764.git.dato@net.com.org.es (mailing list archive)
State New, archived
Headers show
Series [1/3] mm: add include files so that function definitions have a prototype | expand

Commit Message

Adeodato Simó Dec. 4, 2018, 5:14 a.m. UTC
follow_page_context() and __thp_get_unmapped_area() have no public
declarations and are only used in the files that define them (mm/gup.c
and mm/huge_memory.c, respectively).

This change also appeases GCC if run with -Wmissing-prototypes.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
 mm/gup.c         | 6 +++---
 mm/huge_memory.c | 5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

Comments

Mike Rapoport Dec. 4, 2018, 7:48 a.m. UTC | #1
On Tue, Dec 04, 2018 at 02:14:23AM -0300, Adeodato Simó wrote:
> follow_page_context() and __thp_get_unmapped_area() have no public
> declarations and are only used in the files that define them (mm/gup.c
> and mm/huge_memory.c, respectively).
> 
> This change also appeases GCC if run with -Wmissing-prototypes.
> 
> Signed-off-by: Adeodato Simó <dato@net.com.org.es>

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  mm/gup.c         | 6 +++---
>  mm/huge_memory.c | 5 +++--
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index 6dd33e16a806..86a10a9b0344 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -399,9 +399,9 @@ static struct page *follow_p4d_mask(struct vm_area_struct *vma,
>   * an error pointer if there is a mapping to something not represented
>   * by a page descriptor (see also vm_normal_page()).
>   */
> -struct page *follow_page_mask(struct vm_area_struct *vma,
> -			      unsigned long address, unsigned int flags,
> -			      struct follow_page_context *ctx)
> +static struct page *follow_page_mask(struct vm_area_struct *vma,
> +				     unsigned long address, unsigned int flags,
> +				     struct follow_page_context *ctx)
>  {
>  	pgd_t *pgd;
>  	struct page *page;
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 2dba2c1c299a..45c1ff36baf1 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -499,8 +499,9 @@ 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,
> -		loff_t off, unsigned long flags, unsigned long size)
> +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;
>  	loff_t off_end = off + len;
> -- 
> 2.19.2
>
diff mbox series

Patch

diff --git a/mm/gup.c b/mm/gup.c
index 6dd33e16a806..86a10a9b0344 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -399,9 +399,9 @@  static struct page *follow_p4d_mask(struct vm_area_struct *vma,
  * an error pointer if there is a mapping to something not represented
  * by a page descriptor (see also vm_normal_page()).
  */
-struct page *follow_page_mask(struct vm_area_struct *vma,
-			      unsigned long address, unsigned int flags,
-			      struct follow_page_context *ctx)
+static struct page *follow_page_mask(struct vm_area_struct *vma,
+				     unsigned long address, unsigned int flags,
+				     struct follow_page_context *ctx)
 {
 	pgd_t *pgd;
 	struct page *page;
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 2dba2c1c299a..45c1ff36baf1 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -499,8 +499,9 @@  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,
-		loff_t off, unsigned long flags, unsigned long size)
+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;
 	loff_t off_end = off + len;