From: Andrew Morton <akpm@linux-foundation.org>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: "David S. Miller" <davem@davemloft.net>,
Andreas Larsson <andreas@gaisler.com>,
Ankur Arora <ankur.a.arora@oracle.com>,
"David Hildenbrand (Red Hat)" <david@kernel.org>,
sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sparc: Avoid -Wunused-but-set-parameter in clear_user_page()
Date: Mon, 25 May 2026 13:39:47 -0700 [thread overview]
Message-ID: <20260525133947.8e4f427cad8c8fa9c7d9d9a8@linux-foundation.org> (raw)
In-Reply-To: <07713350-d55b-4be7-acf8-3853b08c0358@t-8ch.de>
On Mon, 25 May 2026 21:48:14 +0200 Thomas Weißschuh <linux@weissschuh.net> wrote:
> On 2026-05-25 10:44:39-0700, Andrew Morton wrote:
> > On Mon, 25 May 2026 10:36:21 +0200 Thomas Weißschuh <linux@weissschuh.net> wrote:
> >
> > > The loop in clear_user_pages() iterates over all pages and calls
> > > clear_user_page() for each of them. During the loop "vaddr" is modified.
> > > However on sparc clear_user() is a macro which does not use "vaddr".
> > > The compiler sees a variable which is modified but never used and emits
> > > a warning for that:
> > >
> > > include/linux/highmem.h: In function 'clear_user_pages':
> > > include/linux/highmem.h:234:63: warning: parameter 'vaddr' set but not used [-Wunused-but-set-parameter=]
> > > static inline void clear_user_pages(void *addr, unsigned long vaddr,
> > >
> > > Other architectures use an inline function for clear_user_page() which
> > > avoids the warning. This is not possible on sparc, as
> > > sparc_flush_page_to_ram() is not yet declared where clear_user_page() is
> > > defined. Including cacheflush_32.h will trigger recursive and lots of
> > > other issues.
> > >
> > > So hide the warning with a cast to (void) instead.
> > >
> > > While we are here, do the same for copy_user_page().
> >
> > A pleasing solution to these sorts of problems is often "don't use
> > macros". Other architectures use inlined C for these functions - will
> > that work for sparc?
>
> Probably yes. But it would require a major reshuffling of the header
> files to get the dependencies right. So I went with the easy solution to
> avoid a lot of churn. As I tried to explain this in the patch message.
Oh, OK, thanks, reading skills, sorry for noise.
next prev parent reply other threads:[~2026-05-25 20:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 8:36 Thomas Weißschuh
2026-05-25 17:44 ` Andrew Morton
2026-05-25 19:48 ` Thomas Weißschuh
2026-05-25 20:39 ` Andrew Morton [this message]
2026-06-12 9:15 ` Andreas Larsson
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=20260525133947.8e4f427cad8c8fa9c7d9d9a8@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andreas@gaisler.com \
--cc=ankur.a.arora@oracle.com \
--cc=davem@davemloft.net \
--cc=david@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=sparclinux@vger.kernel.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
all inboxes | Powered by JetHome®