LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] kexec: fix warnig of crash_zero_bytes in crash.c
@ 2019-06-14 23:18 Tiezhu Yang
  2019-06-20 16:39 ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Tiezhu Yang @ 2019-06-14 23:18 UTC (permalink / raw)
  To: tglx, mingo, bp, hpa; +Cc: x86, linux-kernel, vgoyal

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kexec: fix warnig of crash_zero_bytes in crash.c
  2019-06-14 23:18 [PATCH] kexec: fix warnig of crash_zero_bytes in crash.c Tiezhu Yang
@ 2019-06-20 16:39 ` Borislav Petkov
  2019-06-21 13:38   ` Tiezhu Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2019-06-20 16:39 UTC (permalink / raw)
  To: Tiezhu Yang; +Cc: tglx, mingo, hpa, x86, linux-kernel, vgoyal

On Sat, Jun 15, 2019 at 07:18:20AM +0800, Tiezhu Yang wrote:
> 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.

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

-- 
Regards/Gruss,
    Boris.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:Re: [PATCH] kexec: fix warnig of crash_zero_bytes in crash.c
  2019-06-20 16:39 ` Borislav Petkov
@ 2019-06-21 13:38   ` Tiezhu Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Tiezhu Yang @ 2019-06-21 13:38 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: tglx, mingo, hpa, x86, linux-kernel, vgoyal

At 2019-06-21 00:39:00, "Borislav Petkov" <bp@alien8.de> wrote:
>On Sat, Jun 15, 2019 at 07:18:20AM +0800, Tiezhu Yang wrote:
>> 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.
>
>> 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.

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

Thanks,

>
>Thx.
>
>-- 
>Regards/Gruss,
>    Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 23:18 [PATCH] kexec: fix warnig of crash_zero_bytes in crash.c Tiezhu Yang
2019-06-20 16:39 ` Borislav Petkov
2019-06-21 13:38   ` Tiezhu Yang

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 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/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox