x86/vm86: Make sure the free_vm86(task) definition uses its parameter even in the...
authorIngo Molnar <mingo@kernel.org>
Fri, 29 Mar 2024 13:20:40 +0000 (14:20 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 29 Mar 2024 13:24:50 +0000 (14:24 +0100)
I ran into a case in new code where free_vm86(task) was the only
consumer of the 'task' variable:

  arch/x86/kernel/process.c: In function ‘exit_thread’:
  arch/x86/kernel/process.c:118:31: error: unused variable ‘t’ [-Werror=unused-variable]

Robustify the definition in the !CONFIG_VM86 case.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/ZgaFfyHMOdLHEKm+@gmail.com
arch/x86/include/asm/vm86.h

index 9e8ac5073ecb8d770ae57dae490e36b376473689..62ee1990990385271a4ca5a3c818ba75dc9e7f33 100644 (file)
@@ -84,7 +84,7 @@ static inline int handle_vm86_trap(struct kernel_vm86_regs *a, long b, int c)
 
 static inline void save_v86_state(struct kernel_vm86_regs *a, int b) { }
 
-#define free_vm86(t) do { } while(0)
+#define free_vm86(task) do { (void)(task); } while(0)
 
 #endif /* CONFIG_VM86 */