Skip to contentSkip to conversation

x86/entry: Fix unused-function warning

PATCH New Arnd Bergmann 1 participant 1 message May 27, 2020 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/entry: Fix unused-function warning

The new 'address' variable is only used in some configurations:

arch/x86/kernel/traps.c:332:16: error: unused variable 'address' [-Werror,-Wunused-variable]

        unsigned long address = read_cr2();

Change the #ifdef guard to cover this case as well.

Fixes 095b7a3e7745 ("x86/entry: Convert double fault exception to IDTENTRY_DF")
---
 arch/x86/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/traps.c +1 -1
index 35298c1df32f..c9d0d466641a 100644
@@ -328,7 +328,7 @@ DEFINE_IDTENTRY_DF(exc_double_fault)
 	static const char str[] = "double fault";
 	struct task_struct *tsk = current;
 
-#ifdef CONFIG_X86_64
+#if defined(CONFIG_X86_64) && defined(CONFIG_VMAP_STACK)
 	unsigned long address = read_cr2();
 #endif
 
Signature · 1 line
2.26.2