linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: akpm@linux-foundation.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>, linux-mm@kvack.org
Subject: [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning
Date: Tue, 15 Jun 2021 21:02:39 +0100	[thread overview]
Message-ID: <20210615200242.1716568-3-willy@infradead.org> (raw)
In-Reply-To: <20210615200242.1716568-1-willy@infradead.org>

-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(-)

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



  parent reply	other threads:[~2021-06-15 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 20:02 [PATCH 0/5] Remove warnings from today's mmotm Matthew Wilcox (Oracle)
2021-06-15 20:02 ` [PATCH 1/5] mm writeback,cgroup: Fix documentation Matthew Wilcox (Oracle)
2021-06-15 20:02 ` Matthew Wilcox (Oracle) [this message]
2021-06-15 23:16   ` [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning Hugh Dickins
2021-06-15 20:02 ` [PATCH 3/5] mm/thp: Fix strncpy warning Matthew Wilcox (Oracle)
2021-06-15 20:02 ` [PATCH 4/5] mm/sparse-vmemmap: Fix documentation warning Matthew Wilcox (Oracle)
2021-06-15 20:02 ` [PATCH 5/5] mm: Fix alloc_vmemmap_page_list " Matthew Wilcox (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210615200242.1716568-3-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).