lkml.org 
[lkml]   [2020]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 06/21] x86/kaslr: Drop redundant cur_entry from __process_mem_region
Date
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>
---
arch/x86/boot/compressed/kaslr.c | 9 +++------
1 file 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. */
--
2.26.2
\
 
 \ /
  Last update: 2020-07-29 00:58    [W:0.313 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site