Skip to contentSkip to conversation

kexec: fix warnig of crash_zero_bytes in crash.c

PATCH Superseded Tiezhu Yang 2 participants 3 messages Jun 14, 2019 – Jun 21, 2019 x86

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: fix warnig of crash_zero_bytes in crash.c

This patch fixes the following sparse warning:

arch/x86/kernel/crash.c:59:15:
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:

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")
Cc Vivek Goyal <[email protected]>
---
 arch/x86/kernel/crash.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/crash.c +3 -1
index 576b2e1..f13480e 100644
@@ -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)
 {
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 1 line · Tiezhu Yang

This patch fixes the following sparse warning:

Avoid having "This patch" or "This commit" in the commit message. It is tautologically useless.

Also, do

$ git grep 'This patch' Documentation/process

for more details.

Quoted 9 lines

arch/x86/kernel/crash.c:59:15:
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:

arch/x86/kernel/crash.c:59:22:
warning: ‘crash_zero_bytes’ defined but not used [-Wunused-variable]

That happens only when you make it static, so please state that in the commit message.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#2 lore raw
Quoted 19 lines · Borislav Petkov
Quoted 1 line · Tiezhu Yang

This patch fixes the following sparse warning:

Avoid having "This patch" or "This commit" in the commit message. It is tautologically useless.

Also, do

$ git grep 'This patch' Documentation/process

for more details.

Quoted 7 lines

arch/x86/kernel/crash.c:59:15:
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:

Quoted 5 lines
Quoted 2 lines

arch/x86/kernel/crash.c:59:22:
warning: ‘crash_zero_bytes’ defined but not used [-Wunused-variable]

That happens only when you make it static, so please state that in the commit message.

Thanks for your suggestion, I will send a v2 patch.

Thanks,

Quoted 8 lines

Thx.

Signature · 4 lines
Regards/Gruss,
   Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.