[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159675713441.3192.1630860700272865045.tip-bot2@tip-bot2>
Date: Thu, 06 Aug 2020 23:38:54 -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: Drop redundant check in store_slot_info()
The following commit has been merged into the x86/kaslr branch of tip:
Commit-ID: 46a5b29a4a63a3ba987cbb5467774a4b5787618e
Gitweb: https://git.kernel.org/tip/46a5b29a4a63a3ba987cbb5467774a4b5787618e
Author: Arvind Sankar <nivedita@...m.mit.edu>
AuthorDate: Tue, 28 Jul 2020 18:57:16 -04:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00
x86/kaslr: Drop redundant check in store_slot_info()
Drop unnecessary check that number of slots is not zero in
store_slot_info, it's guaranteed to be at least 1 by the calculation.
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-16-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 5c7457c..0c64026 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -525,13 +525,10 @@ static void store_slot_info(struct mem_vector *region, unsigned long image_size)
return;
slot_area.addr = region->start;
- slot_area.num = (region->size - image_size) /
- CONFIG_PHYSICAL_ALIGN + 1;
+ slot_area.num = 1 + (region->size - image_size) / CONFIG_PHYSICAL_ALIGN;
- if (slot_area.num > 0) {
- slot_areas[slot_area_index++] = slot_area;
- slot_max += slot_area.num;
- }
+ slot_areas[slot_area_index++] = slot_area;
+ slot_max += slot_area.num;
}
/*
Powered by blists - more mailing lists