]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/crash: remove redundant 0 value initialization
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Mon, 18 Aug 2025 12:35:28 +0000 (20:35 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 14 Sep 2025 00:32:48 +0000 (17:32 -0700)
The crash_mem struct is already zeroed by vzalloc(). It's redundant to
initialize cmem->nr_ranges to 0.

Link: https://lkml.kernel.org/r/20250818123530.635234-1-liaoyuanhong@vivo.com
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Coiby Xu <coxu@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Bohac <jbohac@suse.cz>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/kernel/crash.c

index c6b12bed173df534256a1866fa4d7031d6cb2a53..60bb24ddd36f55e95d292d6a86fdc358e41eb977 100644 (file)
@@ -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;