From: Andrew Morton Date: Thu, 4 Sep 2025 02:51:59 +0000 (-0700) Subject: mm-constify-highmem-related-functions-for-improved-const-correctness-fix X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3f7e824f30f2a0e149d14fb1546de45d55b51828;p=users%2Fjedix%2Flinux-maple.git mm-constify-highmem-related-functions-for-improved-const-correctness-fix nastily "fix" folio_page() Reported-by: Stephen Rothwell Cc: Max Filippov Cc: Lorenzo Stoakes Cc: David Hildenbrand Cc: Vlastimil Babka Cc: Mike Rapoport (Microsoft) Signed-off-by: Andrew Morton --- diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index faf17ca211b4..a57411252564 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -316,9 +316,9 @@ static __always_inline unsigned long _compound_head(const struct page *page) * check that the page number lies within @folio; the caller is presumed * to have a reference to the page. */ -static inline struct page *folio_page(struct folio *folio, unsigned long n) +static inline struct page *folio_page(const struct folio *folio, unsigned long n) { - return &folio->page + n; + return (struct page *)(&folio->page + n); } static __always_inline int PageTail(const struct page *page)