diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-03-04 20:00:25 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-03-05 16:28:06 +0100 |
commit | 0a4d84b435c672b8144c99394e2c37521c0fa97e (patch) | |
tree | fbb86019606e5e7c2e1b30d46fed266fa99898c5 | |
parent | fcbbd5db1c511ef5101f27ad99526966b159643a (diff) | |
download | barebox-0a4d84b435c6.tar.gz barebox-0a4d84b435c6.tar.xz |
efi: devicepath: format GUIDs as little endian
The default for %pU is to format as big endian, which isn't the correct
representation for EFI GUIDs, which are little endian.
Fix the format specifier to avoid the confusion.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240304190038.3486881-101-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | efi/devicepath.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/efi/devicepath.c b/efi/devicepath.c index 53387d8bd1..d3a0204bd3 100644 --- a/efi/devicepath.c +++ b/efi/devicepath.c @@ -207,7 +207,7 @@ dev_path_vendor(struct string *str, const void *dev_path) break; } - cprintf(str, "Ven%s(%pU", type, &Vendor->Guid); + cprintf(str, "Ven%s(%pUl", type, &Vendor->Guid); if (efi_guidcmp(Vendor->Guid, efi_unknown_device_guid) == 0) { /* GUID used by EFI to enumerate an EDD 1.1 device */ unknown_dev_path = @@ -301,7 +301,7 @@ dev_path1394(struct string *str, const void *dev_path) const struct f1394_device_path *F1394; F1394 = dev_path; - cprintf(str, "1394(%pU)", &F1394->Guid); + cprintf(str, "1394(%pUl)", &F1394->Guid); } static void @@ -464,7 +464,7 @@ dev_path_infini_band(struct string *str, const void *dev_path) const struct infiniband_device_path *infini_band; infini_band = dev_path; - cprintf(str, "Infiniband(0x%x,%pU,0x%llx,0x%llx,0x%llx)", + cprintf(str, "Infiniband(0x%x,%pUl,0x%llx,0x%llx,0x%llx)", infini_band->resource_flags, &infini_band->port_gid, infini_band->service_id, infini_band->target_port_id, infini_band->device_id); @@ -553,10 +553,7 @@ dev_path_hard_drive(struct string *str, const void *dev_path) ); break; case SIGNATURE_TYPE_GUID: - cprintf(str, "HD(Part%d,Sig%pU)", - hd->partition_number, - (efi_guid_t *) & (hd->signature[0]) - ); + cprintf(str, "HD(Part%d,Sig%pUl)", hd->partition_number, (guid_t *)hd->signature); break; default: cprintf(str, "HD(Part%d,mbr_type=%02x,sig_type=%02x)", @@ -595,7 +592,7 @@ dev_path_media_protocol(struct string *str, const void *dev_path) const struct media_protocol_device_path *media_prot; media_prot = dev_path; - cprintf(str, "%pU", &media_prot->Protocol); + cprintf(str, "%pUl", &media_prot->Protocol); } static void |