Skip to contentSkip to conversation

ARM: arch/arm/kernel/signal.c: resolve set-but-not-used warning

PATCH New Ethan Nelson-Moore 1 participant 1 message Jun 10 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: arch/arm/kernel/signal.c: resolve set-but-not-used warning

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 marking the variable with the __maybe_unused attribute.

---
Changes from v1: Use __maybe_unused instead of introducing another layer of ifdefs (suggested by Baruch Siach)

 arch/arm/kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/signal.c +1 -1
index 7be9188d83d9..a7e5e439a735 100644
@@ -140,7 +140,7 @@ static int restore_vfp_context(char __user **auxp)
 static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
 {
 	struct sigcontext context;
-	char __user *aux;
+	char __user *aux __maybe_unused;
 	sigset_t set;
 	int err;
 
Signature · 1 line
2.43.0