diff mbox series

[2/5] Fix hugetlb_basepage_index missing prototype warning

Message ID 20210615200242.1716568-3-willy@infradead.org (mailing list archive)
State New
Headers show
Series Remove warnings from today's mmotm | expand

Commit Message

Matthew Wilcox June 15, 2021, 8:02 p.m. UTC
-Wmissing-prototypes requires that the prototype actually be in scope,
not just previously seen.  Move it outside page_to_pgoff().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/pagemap.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Hugh Dickins June 15, 2021, 11:16 p.m. UTC | #1
On Tue, 15 Jun 2021, Matthew Wilcox (Oracle) wrote:

> -Wmissing-prototypes requires that the prototype actually be in scope,
> not just previously seen.  Move it outside page_to_pgoff().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Thanks Matthew:
Acked-by: Hugh Dickins <hughd@google.com>
but Andrew please just add as a -fix.patch to
mm-futex-fix-shared-futex-pgoff-on-shmem-huge-page.patch
and merge them in due course - thank you.

> ---
>  include/linux/pagemap.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 5f0582de24e7..c4b1514818ff 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -585,16 +585,16 @@ static inline pgoff_t page_to_index(struct page *page)
>  	return pgoff;
>  }
>  
> +extern pgoff_t hugetlb_basepage_index(struct page *page);
> +
>  /*
>   * Get the offset in PAGE_SIZE (even for hugetlb pages).
>   * (TODO: hugetlb pages should have ->index in PAGE_SIZE)
>   */
>  static inline pgoff_t page_to_pgoff(struct page *page)
>  {
> -	if (unlikely(PageHuge(page))) {
> -		extern pgoff_t hugetlb_basepage_index(struct page *page);
> +	if (unlikely(PageHuge(page)))
>  		return hugetlb_basepage_index(page);
> -	}
>  	return page_to_index(page);
>  }
>  
> -- 
> 2.30.2
diff mbox series

Patch

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 5f0582de24e7..c4b1514818ff 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -585,16 +585,16 @@  static inline pgoff_t page_to_index(struct page *page)
 	return pgoff;
 }
 
+extern pgoff_t hugetlb_basepage_index(struct page *page);
+
 /*
  * Get the offset in PAGE_SIZE (even for hugetlb pages).
  * (TODO: hugetlb pages should have ->index in PAGE_SIZE)
  */
 static inline pgoff_t page_to_pgoff(struct page *page)
 {
-	if (unlikely(PageHuge(page))) {
-		extern pgoff_t hugetlb_basepage_index(struct page *page);
+	if (unlikely(PageHuge(page)))
 		return hugetlb_basepage_index(page);
-	}
 	return page_to_index(page);
 }