lib/bootmem: Replace conditional return with assert in bootmem_add_range_from
Promote the condition where new_tag equals from_tag from a runtime error to an assertion, indicating it as a critical programming error that should not occur. Change-Id: I1fe93b7ee0593d27f70ab3702ad4feae85857ea3 Signed-off-by: Yidi Lin <yidilin@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/90678 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
eb814f3b12
commit
999dd8905a
1 changed files with 1 additions and 2 deletions
|
|
@ -144,8 +144,7 @@ void bootmem_add_range(uint64_t start, uint64_t size,
|
|||
int bootmem_add_range_from(uint64_t start, uint64_t size, const enum bootmem_type new_tag,
|
||||
const enum bootmem_type from_tag)
|
||||
{
|
||||
if (new_tag == from_tag)
|
||||
return -1;
|
||||
assert(new_tag != from_tag);
|
||||
|
||||
if (!bootmem_region_targets_type(start, size, from_tag)) {
|
||||
printk(BIOS_ERR, "%s: Failed to add the range [%#llx, %#llx)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue