summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/kaslr.c
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-07-28 18:57:07 -0400
committerIngo Molnar <mingo@kernel.org>2020-07-31 11:08:17 +0200
commit3f9412c73053a5be311607e42560c1303a873be7 (patch)
treee42f6e6d9a5aeb739eea18a50595107f604c46cb /arch/x86/boot/compressed/kaslr.c
parent8d1cf8595860f4807f4ff1f8f1fc53e7576e0d71 (diff)
downloadlinux-3f9412c73053a5be311607e42560c1303a873be7.tar.gz
linux-3f9412c73053a5be311607e42560c1303a873be7.tar.bz2
linux-3f9412c73053a5be311607e42560c1303a873be7.zip
x86/kaslr: Drop redundant cur_entry from __process_mem_region()
cur_entry is only used as cur_entry.start + cur_entry.size, which is always equal to end. 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-7-nivedita@alum.mit.edu
Diffstat (limited to 'arch/x86/boot/compressed/kaslr.c')
-rw-r--r--arch/x86/boot/compressed/kaslr.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index 848346fc0dbb..f2454eef5790 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -624,7 +624,6 @@ static void __process_mem_region(struct mem_vector *entry,
{
struct mem_vector region, overlap;
unsigned long start_orig, end;
- struct mem_vector cur_entry;
/* Ignore entries entirely below our minimum. */
if (entry->start + entry->size < minimum)
@@ -634,11 +633,9 @@ static void __process_mem_region(struct mem_vector *entry,
end = min(entry->size + entry->start, mem_limit);
if (entry->start >= end)
return;
- cur_entry.start = entry->start;
- cur_entry.size = end - entry->start;
- region.start = cur_entry.start;
- region.size = cur_entry.size;
+ region.start = entry->start;
+ region.size = end - entry->start;
/* Give up if slot area array is full. */
while (slot_area_index < MAX_SLOT_AREA) {
@@ -652,7 +649,7 @@ static void __process_mem_region(struct mem_vector *entry,
region.start = ALIGN(region.start, CONFIG_PHYSICAL_ALIGN);
/* Did we raise the address above the passed in memory entry? */
- if (region.start > cur_entry.start + cur_entry.size)
+ if (region.start > end)
return;
/* Reduce size by any delta from the original address. */