[PATCH 1/1] efi_loader: replace find_smbios_table by library function

Ilias Apalodimas ilias.apalodimas at linaro.org
Fri Jan 26 09:17:13 CET 2024


On Fri, 26 Jan 2024 at 10:13, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> The code in find_smbios_table() is redundant to
> efi_get_configuration_table(). Replace it.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  lib/efi_loader/efi_tcg2.c | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
>
> diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
> index 85562c50a1c..b5d4aa7be52 100644
> --- a/lib/efi_loader/efi_tcg2.c
> +++ b/lib/efi_loader/efi_tcg2.c
> @@ -1128,23 +1128,6 @@ out:
>         return ret;
>  }
>
> -/**
> - * find_smbios_table() - find smbios table
> - *
> - * Return:     pointer to the smbios table
> - */
> -static void *find_smbios_table(void)
> -{
> -       u32 i;
> -
> -       for (i = 0; i < systab.nr_tables; i++) {
> -               if (!guidcmp(&smbios3_guid, &systab.tables[i].guid))
> -                       return systab.tables[i].table;
> -       }
> -
> -       return NULL;
> -}
> -
>  /**
>   * tcg2_measure_gpt_table() - measure gpt table
>   *
> @@ -1387,7 +1370,7 @@ efi_status_t efi_tcg2_measure_efi_app_invocation(struct efi_loaded_image_obj *ha
>         if (ret != EFI_SUCCESS)
>                 goto out;
>
> -       entry = (struct smbios3_entry *)find_smbios_table();
> +       entry = efi_get_configuration_table(&smbios3_guid);
>         if (entry) {
>                 ret = tcg2_measure_smbios(dev, entry);
>                 if (ret != EFI_SUCCESS)
> --
> 2.43.0
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>


More information about the U-Boot mailing list