Commit 46a5b29a authored by Arvind Sankar's avatar Arvind Sankar Committed by Ingo Molnar
Browse files

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: default avatarArvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200728225722.67457-16-nivedita@alum.mit.edu
parent d6d0f36c
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -525,14 +525,11 @@ 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;
}
}

/*
 * Skip as many 1GB huge pages as possible in the passed region