grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] efi: library function grub_efi_close_protocol()


From: Daniel Kiper
Subject: Re: [PATCH 2/2] efi: library function grub_efi_close_protocol()
Date: Tue, 23 Nov 2021 18:59:28 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, Oct 06, 2021 at 10:30:43AM +0200, Heinrich Schuchardt wrote:
> Create a library function for CloseProtocol() and use it for the SNP
> driver.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  grub-core/kern/efi/efi.c           | 18 ++++++++++++++++++
>  grub-core/net/drivers/efi/efinet.c |  8 ++------
>  include/grub/efi/efi.h             |  3 +++
>  3 files changed, 23 insertions(+), 6 deletions(-)
>
> diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
> index 8cff7be02..1d331d858 100644
> --- a/grub-core/kern/efi/efi.c
> +++ b/grub-core/kern/efi/efi.c
> @@ -117,6 +117,24 @@ grub_efi_open_protocol (grub_efi_handle_t handle,
>    return interface;
>  }
>
> +grub_efi_status_t
> +grub_efi_close_protocol (grub_efi_handle_t handle,
> +                      grub_efi_guid_t *protocol)

grub_efi_close_protocol (grub_efi_handle_t handle, grub_efi_guid_t *protocol)

> +{
> +  grub_efi_boot_services_t *b;
> +  grub_efi_status_t status;
> +
> +

Please drop this redundant empty line...

> +  b = grub_efi_system_table->boot_services;

I think you could do this above:

grub_efi_boot_services_t *b = grub_efi_system_table->boot_services;

> +  status = efi_call_4 (b->close_protocol,
> +                    handle,
> +                    protocol,
> +                    grub_efi_image_handle,
> +                    0);

status = efi_call_4 (b->close_protocol, handle, protocol, 
grub_efi_image_handle, NULL);

I am OK with lines a bit longer than 80 chars.

Otherwise LGTM.

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]