[PATCH 3/4] efi: Correct display of table GUIDs

Simon Glass sjg at chromium.org
Sun Nov 12 21:01:30 CET 2023


Hi Heinrich,

On Sun, 12 Nov 2023 at 09:58, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> On 11/12/23 16:58, Simon Glass wrote:
> > The printf() %pU option decodes GUIDs so it is not necessary to do this
> > first. Drop the incorrect code.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> >   cmd/efi_common.c | 4 +---
> >   1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/cmd/efi_common.c b/cmd/efi_common.c
> > index f4056096cd3f..1aa2351fcdfd 100644
> > --- a/cmd/efi_common.c
> > +++ b/cmd/efi_common.c
> > @@ -17,10 +17,8 @@ void efi_show_tables(struct efi_system_table *systab)
> >
> >       for (i = 0; i < systab->nr_tables; i++) {
> >               struct efi_configuration_table *tab = &systab->tables[i];
> > -             char guid_str[37];
> >
> > -             uuid_bin_to_str(tab->guid.b, guid_str, 1);
> > -             printf("%p  %pUl  %s\n", tab->table, guid_str,
> > +             printf("%p  %pUl  %s\n", tab->table, tab->guid.b,
> >                      uuid_guid_get_str(tab->guid.b) ?: "(unknown)");
>
> Please, observe, that we have printf("%pUs", &guid) for printing the
> text representation of a GUID. If the text representation is unknown, it
> will print the numeric representation.

Yes, I understand but this is the output I want:

=> efi tables
bfbd7690  ee4e5898-3914-4259-9d6e-dc7bd79403cf  EFI_LZMA_COMPRESSED
bff27c40  05ad34ba-6f02-4214-952e-4da0398e2bb9  EFI_DXE_SERVICES
bfbd4010  7739f24c-93d7-11d4-9a3a-0090273fc14d  EFI_HOB_LIST
bff283c0  4c19049f-4137-4dd3-9c10-8b97a83ffdfa  EFI_MEMORY_TYPE
bff2892c  49152e77-1ada-4764-b7a2-7afefed95e8b  (unknown)
bfcb6210  060cc026-4c0d-4dda-8f41-595fef00a502  EFI_MEM_STATUS_CODE_REC
bfc80000  eb9d2d31-2d88-11d3-9a16-0090273fc14d  SMBIOS table
bfe67000  eb9d2d30-2d88-11d3-9a16-0090273fc14d  EFI_GUID_EFI_ACPI1
bfe67014  8868e871-e4f1-11d3-bc22-0080c73c8881  ACPI table
be9b9010  dcfa911d-26eb-469f-a220-38b7dc461220  (unknown)

(so I want to show the GUID in all cases, but also indicate which ones
are unknown)

Regards,
Simon


More information about the U-Boot mailing list