public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation•org>
To: Stephen Rothwell <sfr@canb•auug.org.au>
Cc: Max Kellermann <max.kellermann@ionos•com>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Linux Next Mailing List <linux-next@vger•kernel.org>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle•com>,
	David Hildenbrand <david@redhat•com>,
	Vlastimil Babka <vbabka@suse•cz>, Mike Rapoport <rppt@kernel•org>,
	Matthew Wilcox <willy@infradead•org>
Subject: Re: linux-next: build warning after merge of the mm-unstable tree
Date: Wed, 3 Sep 2025 19:59:47 -0700	[thread overview]
Message-ID: <20250903195947.97af912dc103f8a055e73537@linux-foundation.org> (raw)
In-Reply-To: <20250904121438.3d2daab2@canb.auug.org.au>

On Thu, 4 Sep 2025 12:14:38 +1000 Stephen Rothwell <sfr@canb•auug.org.au> wrote:

> After merging the mm-unstable tree, today's linux-next build (arm
> multi_v7_defconfig) produced this warning:
> 
> In file included from include/linux/highmem.h:14,
>                  from include/linux/bvec.h:10,
>                  from include/linux/blk_types.h:10,
>                  from include/linux/writeback.h:13,
>                  from include/linux/memcontrol.h:23,
>                  from include/linux/swap.h:9,
>                  from include/linux/suspend.h:5,
>                  from arch/arm/mach-highbank/pm.c:9:
> include/linux/highmem-internal.h: In function 'kmap_local_folio':
> include/linux/highmem-internal.h:86:46: warning: passing argument 1 of 'folio_page' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>    86 |         const struct page *page = folio_page(folio, offset / PAGE_SIZE);
>       |                                              ^~~~~
> In file included from include/linux/mmzone.h:23,
>                  from include/linux/swap.h:7:
> include/linux/page-flags.h:319:53: note: expected 'struct folio *' but argument is of type 'const struct folio *'
>   319 | static inline struct page *folio_page(struct folio *folio, unsigned long n)


Yeah, thanks, folio_page() is a problem.  I'll do the below nasty for
now, but nasty.

--- a/include/linux/page-flags.h~mm-constify-highmem-related-functions-for-improved-const-correctness-fix
+++ a/include/linux/page-flags.h
@@ -316,9 +316,9 @@ static __always_inline unsigned long _co
  * 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)
_


  reply	other threads:[~2025-09-04  2:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04  2:14 linux-next: build warning after merge of the mm-unstable tree Stephen Rothwell
2025-09-04  2:59 ` Andrew Morton [this message]
2025-09-04  6:33   ` David Hildenbrand
  -- strict thread matches above, loose matches on Subject: below --
2025-11-07  3:39 Stephen Rothwell
2025-11-07  6:51 ` Randy Dunlap
2025-10-20  2:49 Stephen Rothwell
2025-10-20  2:45 Stephen Rothwell
2025-10-20  3:41 ` Baoquan He
2025-10-20  4:19   ` Bagas Sanjaya
2025-09-12  4:12 Stephen Rothwell
2025-09-12  4:58 ` Balbir Singh
2025-07-15  8:55 Stephen Rothwell
2025-07-15 18:54 ` SeongJae Park
2025-07-10  7:54 Stephen Rothwell
2025-07-10 22:30 ` Andrew Morton
2025-07-10 22:49   ` Stephen Rothwell
2025-07-11  0:36   ` Randy Dunlap
2025-07-11  6:28   ` David Hildenbrand
2025-07-10  7:50 Stephen Rothwell
2025-07-11  9:57 ` David Hildenbrand
2025-06-10  4:33 Stephen Rothwell
2025-06-10  4:35 ` Christoph Hellwig
2025-05-09  9:43 Stephen Rothwell
2025-05-09 20:31 ` Andrew Morton

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=20250903195947.97af912dc103f8a055e73537@linux-foundation.org \
    --to=akpm@linux-foundation$(echo .)org \
    --cc=david@redhat$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=lorenzo.stoakes@oracle$(echo .)com \
    --cc=max.kellermann@ionos$(echo .)com \
    --cc=rppt@kernel$(echo .)org \
    --cc=sfr@canb$(echo .)auug.org.au \
    --cc=vbabka@suse$(echo .)cz \
    --cc=willy@infradead$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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