All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/crash: Remove redundant 0 value initialization
@ 2025-08-18 12:35 Liao Yuanhong
  2025-08-18 18:46 ` Markus Elfring
  0 siblings, 1 reply; 2+ messages in thread
From: Liao Yuanhong @ 2025-08-18 12:35 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin,
	Andrew Morton, Brian Gerst, Coiby Xu, Baoquan He, Jiri Bohac,
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)
  Cc: Liao Yuanhong

The crash_mem struct is already zeroed by vzalloc(). It's redundant to
initialize cmem->nr_ranges to 0.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 arch/x86/kernel/crash.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index c6b12bed173d..60bb24ddd36f 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -172,7 +172,6 @@ static struct crash_mem *fill_up_crash_elf_data(void)
 		return NULL;
 
 	cmem->max_nr_ranges = nr_ranges;
-	cmem->nr_ranges = 0;
 
 	return cmem;
 }
@@ -332,7 +331,6 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
 		return -ENOMEM;
 
 	cmem->max_nr_ranges = nr_ranges;
-	cmem->nr_ranges = 0;
 
 	memset(&cmd, 0, sizeof(struct crash_memmap_data));
 	cmd.params = params;
-- 
2.34.1


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

* Re: [PATCH] x86/crash: Remove redundant 0 value initialization
  2025-08-18 12:35 [PATCH] x86/crash: Remove redundant 0 value initialization Liao Yuanhong
@ 2025-08-18 18:46 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2025-08-18 18:46 UTC (permalink / raw)
  To: Liao Yuanhong, x86
  Cc: LKML, Andrew Morton, Baoquan He, Borislav Petkov, Brian Gerst,
	Coiby Xu, Dave Hansen, H. Peter Anvin, Ingo Molnar, Jiri Bohac,
	Thomas Gleixner

> The crash_mem struct is already zeroed by vzalloc(). It's redundant to
> initialize cmem->nr_ranges to 0.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17-rc2#n94

Regards,
Markus

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

end of thread, other threads:[~2025-08-18 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 12:35 [PATCH] x86/crash: Remove redundant 0 value initialization Liao Yuanhong
2025-08-18 18:46 ` Markus Elfring

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.