[lkml]   [2019]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v2 RESEND] kexec: fix warnig of crash_zero_bytes in crash.c
Fix the following sparse warning:

warning: symbol 'crash_zero_bytes' was not declared. Should it be static?

First, make crash_zero_bytes static. In addition, crash_zero_bytes
is used when CONFIG_KEXEC_FILE is set, so make it only available
under CONFIG_KEXEC_FILE. Otherwise, if CONFIG_KEXEC_FILE is not set,
the following warning will appear when make crash_zero_bytes static:

warning: ‘crash_zero_bytes’ defined but not used [-Wunused-variable]

Fixes: dd5f726076cc ("kexec: support for kexec on panic using new system call")
Signed-off-by: Tiezhu Yang <>
Acked-by: Dave Young <>
Cc: Vivek Goyal <>
arch/x86/kernel/crash.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 576b2e1..f13480e 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -56,7 +56,9 @@ struct crash_memmap_data {
crash_vmclear_fn __rcu *crash_vmclear_loaded_vmcss = NULL;
-unsigned long crash_zero_bytes;
+static unsigned long crash_zero_bytes;

static inline void cpu_crash_vmclear_loaded_vmcss(void)
 \ /
  Last update: 2019-06-24 06:43    [W:0.039 / U:36.872 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site