The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] ARM: arch/arm/kernel/signal.c: resolve set-but-not-used warning
@ 2026-06-08  5:09 Ethan Nelson-Moore
  2026-06-08  5:29 ` Arnd Bergmann
  2026-06-08  5:36 ` Baruch Siach
  0 siblings, 2 replies; 3+ messages in thread
From: Ethan Nelson-Moore @ 2026-06-08  5:09 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: Ethan Nelson-Moore, Russell King, Arnd Bergmann,
	Thomas Weißschuh

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;
+#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;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: arch/arm/kernel/signal.c: resolve set-but-not-used warning
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-06-08  5:29 UTC (permalink / raw)
  To: Ethan Nelson-Moore, linux-arm-kernel, linux-kernel
  Cc: Russell King, Thomas Weißschuh

On Mon, Jun 8, 2026, at 07:09, 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>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: arch/arm/kernel/signal.c: resolve set-but-not-used warning
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Baruch Siach @ 2026-06-08  5:36 UTC (permalink / raw)
  To: Ethan Nelson-Moore
  Cc: linux-arm-kernel, linux-kernel, Russell King, Arnd Bergmann,
	Thomas Weißschuh

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 -

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-08  5:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox