From ed0cf4171f1f61afeec51da783bcb12a29daeebc Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Sun, 7 Jan 2024 14:43:43 -0500 Subject: [PATCH] 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. --- src/boot/efi/part-discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.3