[PATCH 1/1] efi_selftest: remove superfluous assignments

Ilias Apalodimas ilias.apalodimas at linaro.org
Mon Jul 31 09:24:25 CEST 2023


On Sun, 30 Jul 2023 at 11:35, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> In test_hii_database_list_package_lists() 'ret' is used for the return code
> of EFI API calls and 'result' for the return value of the function. Writing
> EFI_ST_FAILURE to ret is superfluous.
>
> Fixes: 4c4fb10da294 ("efi_selftest: add HII database protocols test")
> Fixes: ee3c8ba85525 ("efi_selftest: fix memory allocation in HII tests")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  lib/efi_selftest/efi_selftest_hii.c | 11 -----------
>  1 file changed, 11 deletions(-)
>
> diff --git a/lib/efi_selftest/efi_selftest_hii.c b/lib/efi_selftest/efi_selftest_hii.c
> index f4b55889e2..f219c0120a 100644
> --- a/lib/efi_selftest/efi_selftest_hii.c
> +++ b/lib/efi_selftest/efi_selftest_hii.c
> @@ -220,14 +220,12 @@ static int test_hii_database_list_package_lists(void)
>         if (ret != EFI_BUFFER_TOO_SMALL) {
>                 efi_st_error("list_package_lists returned %u\n",
>                              (unsigned int)ret);
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = boottime->allocate_pool(EFI_LOADER_DATA, handles_size,
>                                       (void **)&handles);
>         if (ret != EFI_SUCCESS) {
>                 efi_st_error("AllocatePool failed\n");
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = hii_database_protocol->list_package_lists(hii_database_protocol,
> @@ -236,7 +234,6 @@ static int test_hii_database_list_package_lists(void)
>         if (ret != EFI_SUCCESS) {
>                 efi_st_error("list_package_lists returned %u\n",
>                              (unsigned int)ret);
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = boottime->free_pool(handles);
> @@ -254,14 +251,12 @@ static int test_hii_database_list_package_lists(void)
>         if (ret != EFI_BUFFER_TOO_SMALL) {
>                 efi_st_error("list_package_lists returned %u\n",
>                              (unsigned int)ret);
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = boottime->allocate_pool(EFI_LOADER_DATA, handles_size,
>                                       (void **)&handles);
>         if (ret != EFI_SUCCESS) {
>                 efi_st_error("AllocatePool failed\n");
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = hii_database_protocol->list_package_lists(hii_database_protocol,
> @@ -270,13 +265,11 @@ static int test_hii_database_list_package_lists(void)
>         if (ret != EFI_SUCCESS) {
>                 efi_st_error("list_package_lists returned %u\n",
>                              (unsigned int)ret);
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = boottime->free_pool(handles);
>         if (ret != EFI_SUCCESS) {
>                 efi_st_error("FreePool failed\n");
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>
> @@ -289,14 +282,12 @@ static int test_hii_database_list_package_lists(void)
>         if (ret != EFI_BUFFER_TOO_SMALL) {
>                 efi_st_error("list_package_lists returned %u\n",
>                              (unsigned int)ret);
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = boottime->allocate_pool(EFI_LOADER_DATA, handles_size,
>                                       (void **)&handles);
>         if (ret != EFI_SUCCESS) {
>                 efi_st_error("AllocatePool failed\n");
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = hii_database_protocol->list_package_lists(hii_database_protocol,
> @@ -305,13 +296,11 @@ static int test_hii_database_list_package_lists(void)
>         if (ret != EFI_SUCCESS) {
>                 efi_st_error("list_package_lists returned %u\n",
>                              (unsigned int)ret);
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>         ret = boottime->free_pool(handles);
>         if (ret != EFI_SUCCESS) {
>                 efi_st_error("FreePool failed\n");
> -               ret = EFI_ST_FAILURE;
>                 goto out;
>         }
>
> --
> 2.40.1
>

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


More information about the U-Boot mailing list