LKML Archive on
 help / color / Atom feed
From: "Tiezhu Yang" <>
Subject: [PATCH] kexec: fix warnig of crash_zero_bytes in crash.c
Date: Sat, 15 Jun 2019 07:18:20 +0800 (CST)
Message-ID: <> (raw)

This patch fixes the following sparse warning:

warning: symbol 'crash_zero_bytes' was not declared. Should it be 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:

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 <>
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)

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 23:18 Tiezhu Yang [this message]
2019-06-20 16:39 ` Borislav Petkov
2019-06-21 13:38   ` Tiezhu Yang

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox