From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Sun, 7 Jan 2024 19:43:43 +0000 (-0500) Subject: boot/efi: use Header field of hd directly instead of casting to EFI_DEVICE_PATH X-Git-Tag: v256-rc1~1196 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed0cf4171f1f61afeec51da783bcb12a29daeebc;p=thirdparty%2Fsystemd.git boot/efi: use Header field of hd directly instead of casting to EFI_DEVICE_PATH The header of EFI_DEVICE_PATH is the first member of hd, which means that we can use that directly instead of casting one struct to another. --- diff --git a/src/boot/efi/part-discovery.c b/src/boot/efi/part-discovery.c index f5b15730559..e66e2daf304 100644 --- a/src/boot/efi/part-discovery.c +++ b/src/boot/efi/part-discovery.c @@ -232,7 +232,7 @@ static EFI_STATUS find_device(const EFI_GUID *type, EFI_HANDLE *device, EFI_DEVI } /* Patch in the data we found */ - *ret_device_path = device_path_replace_node(partition_path, part_node, (EFI_DEVICE_PATH *) &hd); + *ret_device_path = device_path_replace_node(partition_path, part_node, &hd.Header); return EFI_SUCCESS; }