]> git.baikalelectronics.ru Git - kernel.git/commitdiff
x86/kaslr: Drop redundant variable in __process_mem_region()
authorArvind Sankar <nivedita@alum.mit.edu>
Tue, 28 Jul 2020 22:57:09 +0000 (18:57 -0400)
committerIngo Molnar <mingo@kernel.org>
Fri, 31 Jul 2020 09:08:17 +0000 (11:08 +0200)
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 <nivedita@alum.mit.edu>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200728225722.67457-9-nivedita@alum.mit.edu
arch/x86/boot/compressed/kaslr.c

index e978c3508814ce2d12c473e9e376b0749ddd5bd7..8cc47faea56de9a9761338ca21de63dcf6df71cc 100644 (file)
@@ -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(&region, image_size);
                }
 
                /* Return if overlap extends to or past end of region. */