public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH 1/1] efi_loader: simplify efi_set_load_options()
Date: Mon, 10 Oct 2022 11:01:27 +0300	[thread overview]
Message-ID: <Y0PRVwBypgZcyY9V@hades> (raw)
In-Reply-To: <20221008071300.5902-1-heinrich.schuchardt@canonical.com>

On Sat, Oct 08, 2022 at 09:13:00AM +0200, Heinrich Schuchardt wrote:
> * Replace the OpenProtocol() call by efi_search_protocol().
> * Remove the CloseProtocol() call.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  lib/efi_loader/efi_load_options.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/lib/efi_loader/efi_load_options.c b/lib/efi_loader/efi_load_options.c
> index 71454f0fc6..3cfddee014 100644
> --- a/lib/efi_loader/efi_load_options.c
> +++ b/lib/efi_loader/efi_load_options.c
> @@ -27,23 +27,18 @@ efi_status_t efi_set_load_options(efi_handle_t handle,
>  				  void *load_options)
>  {
>  	struct efi_loaded_image *loaded_image_info;
> +	struct efi_handler *handler;
>  	efi_status_t ret;
>  
> -	ret = EFI_CALL(systab.boottime->open_protocol(
> -					handle,
> -					&efi_guid_loaded_image,
> -					(void **)&loaded_image_info,
> -					efi_root, NULL,
> -					EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL));
> +	ret = efi_search_protocol(handle, &efi_guid_loaded_image, &handler);
> +	loaded_image_info = handler->protocol_interface;
>  	if (ret != EFI_SUCCESS)
>  		return EFI_INVALID_PARAMETER;
>  
>  	loaded_image_info->load_options = load_options;
>  	loaded_image_info->load_options_size = load_options_size;
>  
> -	return EFI_CALL(systab.boottime->close_protocol(handle,
> -							&efi_guid_loaded_image,
> -							efi_root, NULL));
> +	return EFI_SUCCESS;
>  }
>  
>  /**
> -- 
> 2.37.2
> 
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


      reply	other threads:[~2022-10-10  8:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-08  7:13 [PATCH 1/1] efi_loader: simplify efi_set_load_options() Heinrich Schuchardt
2022-10-10  8:01 ` Ilias Apalodimas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0PRVwBypgZcyY9V@hades \
    --to=ilias.apalodimas@linaro.org \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox