From: Arvind Sankar Date: Tue, 28 Jul 2020 22:57:09 +0000 (-0400) Subject: x86/kaslr: Drop redundant variable in __process_mem_region() X-Git-Tag: baikal/aarch64/sdk6.1~8233^2~14 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=a1ce6fed2df0df10953d0c6046fcd4a0734209e3;p=kernel.git x86/kaslr: Drop redundant variable in __process_mem_region() region.size can be trimmed to store the portion of the region before the overlap, instead of a separate mem_vector variable. Signed-off-by: Arvind Sankar Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-9-nivedita@alum.mit.edu --- diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index e978c3508814c..8cc47faea56de 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -664,11 +664,8 @@ static void __process_mem_region(struct mem_vector *entry, /* Store beginning of region if holds at least image_size. */ if (overlap.start >= region.start + image_size) { - struct mem_vector beginning; - - beginning.start = region.start; - beginning.size = overlap.start - region.start; - process_gb_huge_pages(&beginning, image_size); + region.size = overlap.start - region.start; + process_gb_huge_pages(®ion, image_size); } /* Return if overlap extends to or past end of region. */