efi_loader: Avoid assigning desc in efi_mem_carve_out()
Rather than assigning desc and then changing two fields, assign all four fields, for clarity. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -268,9 +268,10 @@ static s64 efi_mem_carve_out(struct efi_mem_list *map,
|
||||
newmap = calloc(1, sizeof(*newmap));
|
||||
if (!newmap)
|
||||
return EFI_CARVE_OUT_OF_RESOURCES;
|
||||
newmap->desc = map->desc;
|
||||
newmap->desc.type = map->desc.type;
|
||||
newmap->desc.physical_start = carve_start;
|
||||
newmap->desc.num_pages = (map_end - carve_start) >> EFI_PAGE_SHIFT;
|
||||
newmap->desc.attribute = map->desc.attribute;
|
||||
/* Insert before current entry (descending address order) */
|
||||
list_add_tail(&newmap->link, &map->link);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user