From: Baruch Siach <baruch@tkos.co.il>
To: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
"Russell King" <linux@armlinux.org.uk>,
"Arnd Bergmann" <arnd@arndb.de>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: Re: [PATCH] ARM: arch/arm/kernel/signal.c: resolve set-but-not-used warning
Date: Mon, 08 Jun 2026 08:36:30 +0300 [thread overview]
Message-ID: <87tsrd8ug1.fsf@tarshish> (raw)
In-Reply-To: <20260608050926.88446-1-enelsonmoore@gmail.com> (Ethan Nelson-Moore's message of "Sun, 7 Jun 2026 22:09:24 -0700")
Hi Ethan,
On Sun, Jun 07 2026, Ethan Nelson-Moore wrote:
> If neither CONFIG_IWMMXT nor CONFIG_VFP are enabled (which is the case,
> for example, in rpc_defconfig), the variable "aux" is set but not used,
> which generates a warning during W=1 builds. Resolve this issue by only
> defining the variable if it will be used.
>
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
> ---
> arch/arm/kernel/signal.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
> index 7be9188d83d9..1d015b696a76 100644
> --- a/arch/arm/kernel/signal.c
> +++ b/arch/arm/kernel/signal.c
> @@ -140,7 +140,9 @@ static int restore_vfp_context(char __user **auxp)
> static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
> {
> struct sigcontext context;
> +#if defined(CONFIG_IWMMXT) || defined(CONFIG_VFP)
> char __user *aux;
__maybe_unused is a common attribute marking local variables that are not
always used. I find it nicer than another layer of #ifdef.
baruch
> +#endif
> sigset_t set;
> int err;
>
> @@ -171,6 +173,7 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
>
> err |= !valid_user_regs(regs);
>
> +#if defined(CONFIG_IWMMXT) || defined(CONFIG_VFP)
> aux = (char __user *) sf->uc.uc_regspace;
> #ifdef CONFIG_IWMMXT
> if (err == 0)
> @@ -180,6 +183,7 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
> if (err == 0)
> err |= restore_vfp_context(&aux);
> #endif
> +#endif /* defined(CONFIG_IWMMXT) || defined(CONFIG_VFP) */
>
> return err;
> }
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
prev parent reply other threads:[~2026-06-08 5:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 5:09 [PATCH] ARM: arch/arm/kernel/signal.c: resolve set-but-not-used warning Ethan Nelson-Moore
2026-06-08 5:29 ` Arnd Bergmann
2026-06-08 5:36 ` Baruch Siach [this message]
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=87tsrd8ug1.fsf@tarshish \
--to=baruch@tkos.co.il \
--cc=arnd@arndb.de \
--cc=enelsonmoore@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=thomas.weissschuh@linutronix.de \
/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