kexec: fix warnig of crash_zero_bytes in crash.c
PATCH v2 1/1 kexec: fix warnig of crash_zero_bytes in crash.c
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]
--- arch/x86/kernel/crash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/crash.c +3 -1
@@ -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
Quoted 37 lines · Tiezhu Yang
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_bytesstatic. In addition,crash_zero_bytesis used whenCONFIG_KEXEC_FILEis set, so make it only available underCONFIG_KEXEC_FILE. Otherwise, ifCONFIG_KEXEC_FILEis not set, the following warning will appear when makecrash_zero_bytesstatic:
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 <[email protected]>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@@ -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
Thanks
Dave
Quoted 34 lines · Dave Young
Quoted 33 lines · Tiezhu Yang
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_bytesstatic. In addition,crash_zero_bytesis used whenCONFIG_KEXEC_FILEis set, so make it only available underCONFIG_KEXEC_FILE. Otherwise, ifCONFIG_KEXEC_FILEis not set, the following warning will appear when makecrash_zero_bytesstatic:
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 <[email protected]>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@@ -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
Quoted 6 lines
Quoted 4 lines
arch/x86/kernel/crash.c +0
-0static inline void cpu_crash_vmclear_loaded_vmcss (void ) {Signature · 1 line
1.8.3.1Acked-by Dave Young <[email protected]>
BTW, a soft reminder, for kexec patches, it would be better to cc kexec mail list.
Quoted 4 lines
Thanks
Dave
Quoted 42 lines · Dave Young
Quoted 34 lines · Dave Young
Quoted 33 lines · Tiezhu Yang
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_bytesstatic. In addition,crash_zero_bytesis used whenCONFIG_KEXEC_FILEis set, so make it only available underCONFIG_KEXEC_FILE. Otherwise, ifCONFIG_KEXEC_FILEis not set, the following warning will appear when makecrash_zero_bytesstatic:
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 <[email protected]>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@@ -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 Quoted 6 lines
Quoted 4 lines
arch/x86/kernel/crash.c +0
-0static inline void cpu_crash_vmclear_loaded_vmcss (void ) {Signature · 1 line
1.8.3.1Acked-by Dave Young <[email protected]>
Quoted 2 lines
BTW, a soft reminder, for kexec patches, it would be better to cc kexec mail list.
Thank you for reminding me of that, I will resend it with a Cc to [email protected].
Thanks,
Quoted 5 lines
Quoted 5 lines
Thanks
Dave