mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00: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@alum.mit.edu> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20200728225722.67457-16-nivedita@alum.mit.edu
This commit is contained in:
parent
d6d0f36c73
commit
46a5b29a4a
1 changed files with 3 additions and 6 deletions
|
@ -525,13 +525,10 @@ static void store_slot_info(struct mem_vector *region, unsigned long image_size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
slot_area.addr = region->start;
|
slot_area.addr = region->start;
|
||||||
slot_area.num = (region->size - image_size) /
|
slot_area.num = 1 + (region->size - image_size) / CONFIG_PHYSICAL_ALIGN;
|
||||||
CONFIG_PHYSICAL_ALIGN + 1;
|
|
||||||
|
|
||||||
if (slot_area.num > 0) {
|
slot_areas[slot_area_index++] = slot_area;
|
||||||
slot_areas[slot_area_index++] = slot_area;
|
slot_max += slot_area.num;
|
||||||
slot_max += slot_area.num;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue