Re: [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning

From
Hugh Dickins <hughd@google.com>
Date
2021-06-15 23:17:15
Reply to
Matthew Wilcox (Oracle), 2021-06-15
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.
quoted hunk ↗ jump to hunk
---
 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
  
Thread (7 messages) 7 messages, 2 authors, last reply 2021-06-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help