Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/kexec: simplify the logic of mem_region_callback()

The expression `mstart + resource_size(res) - 1` is actually equivalent to
`res->end`, simplify the logic of this function to improve readability.

Link: https://lkml.kernel.org/r/20231212150506.31711-1-ytcoode@gmail.com
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Simon Horman <horms@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Yuntao Wang and committed by
Andrew Morton
8474f82a db6b6fb7

+2 -5
+2 -5
arch/x86/kernel/machine_kexec_64.c
··· 42 42 static int mem_region_callback(struct resource *res, void *arg) 43 43 { 44 44 struct init_pgtable_data *data = arg; 45 - unsigned long mstart, mend; 46 45 47 - mstart = res->start; 48 - mend = mstart + resource_size(res) - 1; 49 - 50 - return kernel_ident_mapping_init(data->info, data->level4p, mstart, mend); 46 + return kernel_ident_mapping_init(data->info, data->level4p, 47 + res->start, res->end); 51 48 } 52 49 53 50 static int