[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159675713954.3192.11679980179045433723.tip-bot2@tip-bot2>
Date: Thu, 06 Aug 2020 23:38:59 -0000
From: "tip-bot2 for Arvind Sankar" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Arvind Sankar <nivedita@...m.mit.edu>,
Ingo Molnar <mingo@...nel.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: x86/kaslr] x86/kaslr: Eliminate 'start_orig' local variable
from __process_mem_region()
The following commit has been merged into the x86/kaslr branch of tip:
Commit-ID: ee435ee6490d147c1b9963cc8b331665e4cea634
Gitweb: https://git.kernel.org/tip/ee435ee6490d147c1b9963cc8b331665e4cea634
Author: Arvind Sankar <nivedita@...m.mit.edu>
AuthorDate: Tue, 28 Jul 2020 18:57:08 -04:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00
x86/kaslr: Eliminate 'start_orig' local variable from __process_mem_region()
Set the region.size within the loop, which removes the need for
start_orig.
Signed-off-by: Arvind Sankar <nivedita@...m.mit.edu>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Link: https://lore.kernel.org/r/20200728225722.67457-8-nivedita@alum.mit.edu
---
arch/x86/boot/compressed/kaslr.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index f2454ee..e978c35 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -623,7 +623,7 @@ static void __process_mem_region(struct mem_vector *entry,
unsigned long image_size)
{
struct mem_vector region, overlap;
- unsigned long start_orig, end;
+ unsigned long end;
/* Ignore entries entirely below our minimum. */
if (entry->start + entry->size < minimum)
@@ -635,12 +635,9 @@ static void __process_mem_region(struct mem_vector *entry,
return;
region.start = entry->start;
- region.size = end - entry->start;
/* Give up if slot area array is full. */
while (slot_area_index < MAX_SLOT_AREA) {
- start_orig = region.start;
-
/* Potentially raise address to minimum location. */
if (region.start < minimum)
region.start = minimum;
@@ -653,7 +650,7 @@ static void __process_mem_region(struct mem_vector *entry,
return;
/* Reduce size by any delta from the original address. */
- region.size -= region.start - start_orig;
+ region.size = end - region.start;
/* Return if region can't contain decompressed kernel */
if (region.size < image_size)
@@ -679,7 +676,6 @@ static void __process_mem_region(struct mem_vector *entry,
return;
/* Clip off the overlapping region and start over. */
- region.size -= overlap.start - region.start + overlap.size;
region.start = overlap.start + overlap.size;
}
}
Powered by blists - more mailing lists