mirror of
https://xff.cz/git/u-boot/
synced 2025-10-28 00:53:24 +01:00
efi_loader: Clean up efi_dp_append and efi_dp_concat
Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
committed by
Heinrich Schuchardt
parent
753f76e417
commit
f19171c919
@@ -143,7 +143,7 @@ static efi_status_t try_load_from_file_path(efi_handle_t *fs_handles,
|
||||
if (!dp)
|
||||
continue;
|
||||
|
||||
dp = efi_dp_append(dp, fp);
|
||||
dp = efi_dp_concat(dp, fp, false);
|
||||
if (!dp)
|
||||
continue;
|
||||
|
||||
@@ -1579,8 +1579,8 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
|
||||
goto out;
|
||||
msg_path = file_path;
|
||||
} else {
|
||||
file_path = efi_dp_append(bootefi_device_path,
|
||||
bootefi_image_path);
|
||||
file_path = efi_dp_concat(bootefi_device_path,
|
||||
bootefi_image_path, false);
|
||||
msg_path = bootefi_image_path;
|
||||
log_debug("Loaded from disk\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user