linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/entry: Fix unused-function warning
@ 2020-05-27 13:48 Arnd Bergmann
  0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2020-05-27 13:48 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	Alexandre Chartre, Andy Lutomirski, Peter Zijlstra
  Cc: Arnd Bergmann, H. Peter Anvin, Eric W. Biederman, linux-kernel

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 35298c1df32f..c9d0d466641a 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -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
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-27 13:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 13:48 [PATCH] x86/entry: Fix unused-function warning Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).