From: "Tiezhu Yang" <kernelpatch@126.com>
To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com
Cc: x86@kernel.org, linux-kernel@vger.kernel.org, vgoyal@redhat.com
Subject: [PATCH v2] kexec: fix warnig of crash_zero_bytes in crash.c
Date: Sun, 23 Jun 2019 06:24:01 +0800 (CST) [thread overview]
Message-ID: <43d6fe3a.18e.16b814a09ba.Coremail.kernelpatch@126.com> (raw)
Fix the following sparse warning:
arch/x86/kernel/crash.c:59:15:
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:
arch/x86/kernel/crash.c:59:22:
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 <kernelpatch@126.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
---
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;
EXPORT_SYMBOL_GPL(crash_vmclear_loaded_vmcss);
-unsigned long crash_zero_bytes;
+#ifdef CONFIG_KEXEC_FILE
+static unsigned long crash_zero_bytes;
+#endif
static inline void cpu_crash_vmclear_loaded_vmcss(void)
{
--
1.8.3.1
next reply other threads:[~2019-06-22 22:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-22 22:24 Tiezhu Yang [this message]
2019-06-24 1:35 ` [PATCH v2] kexec: fix warnig of crash_zero_bytes in crash.c Dave Young
2019-06-24 1:53 ` Dave Young
2019-06-24 4:26 ` Tiezhu Yang
Reply instructions:
You may reply publicly 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43d6fe3a.18e.16b814a09ba.Coremail.kernelpatch@126.com \
--to=kernelpatch@126.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=vgoyal@redhat.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.