Hi Heinrich,
On Mon, 27 Mar 2023 at 06:28, Heinrich Schuchardt
<[email protected]> wrote:
>
> Use function uclass_get_dp_node() to construct device paths.
>
> Signed-off-by: Heinrich Schuchardt <[email protected]>
> ---
> lib/efi_loader/efi_device_path.c | 325 +++----------------------------
> 1 file changed, 28 insertions(+), 297 deletions(-)
This is definitely a step in the right direction. Thank you for working on it.
[..]
> + dp = uclass_get_dp_node(dev);
> + if (dp) {
> + memcpy(buf, dp, dp->length);
> + buf += dp->length;
> + efi_free_pool(dp);
This suggests that the API should be:
int uclass_get_dp_node(struct xxx *dp)
with it writing the data to the provided pointer address and returning
the number of bytes used. That would avoid the malloc() / free().
> }
> +
> + return buf;
> }
>
> static unsigned dp_part_size(struct blk_desc *desc, int part)
> --
> 2.39.2
>
Regards,
Simon