]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm-constify-highmem-related-functions-for-improved-const-correctness-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Sep 2025 02:51:59 +0000 (19:51 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:25:44 +0000 (17:25 -0700)
nastily "fix" folio_page()

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/page-flags.h

index faf17ca211b4fea7a46ecee2c700aca5cd9f4b0e..a574112525645a90d32b4d2b18824a45afd49655 100644 (file)
@@ -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)