Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/1] efi/esrt: unused variable in __init efi_esrt_init
@ 2020-02-23 20:45 Heinrich Schuchardt
  2020-02-23 21:24 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2020-02-23 20:45 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-efi, linux-kernel, Heinrich Schuchardt

Remove an unused variable in __init efi_esrt_init().
Simplify a logical constraint.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/firmware/efi/esrt.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
index 2762e0662bf4..e3d692696583 100644
--- a/drivers/firmware/efi/esrt.c
+++ b/drivers/firmware/efi/esrt.c
@@ -240,7 +240,6 @@ void __init efi_esrt_init(void)
 {
 	void *va;
 	struct efi_system_resource_table tmpesrt;
-	struct efi_system_resource_entry_v1 *v1_entries;
 	size_t size, max, entry_size, entries_size;
 	efi_memory_desc_t md;
 	int rc;
@@ -288,14 +287,13 @@ void __init efi_esrt_init(void)
 	memcpy(&tmpesrt, va, sizeof(tmpesrt));
 	early_memunmap(va, size);

-	if (tmpesrt.fw_resource_version == 1) {
-		entry_size = sizeof (*v1_entries);
-	} else {
+	if (tmpesrt.fw_resource_version != 1) {
 		pr_err("Unsupported ESRT version %lld.\n",
 		       tmpesrt.fw_resource_version);
 		return;
 	}

+	entry_size = sizeof(struct efi_system_resource_entry_v1);
 	if (tmpesrt.fw_resource_count > 0 && max - size < entry_size) {
 		pr_err("ESRT memory map entry can only hold the header. (max: %zu size: %zu)\n",
 		       max - size, entry_size);
--
2.25.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] efi/esrt: unused variable in __init efi_esrt_init
  2020-02-23 20:45 [PATCH 1/1] efi/esrt: unused variable in __init efi_esrt_init Heinrich Schuchardt
@ 2020-02-23 21:24 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2020-02-23 21:24 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: linux-efi, Linux Kernel Mailing List

On Sun, 23 Feb 2020 at 21:46, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Remove an unused variable in __init efi_esrt_init().
> Simplify a logical constraint.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Queued in efi/next, thanks

> ---
>  drivers/firmware/efi/esrt.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
> index 2762e0662bf4..e3d692696583 100644
> --- a/drivers/firmware/efi/esrt.c
> +++ b/drivers/firmware/efi/esrt.c
> @@ -240,7 +240,6 @@ void __init efi_esrt_init(void)
>  {
>         void *va;
>         struct efi_system_resource_table tmpesrt;
> -       struct efi_system_resource_entry_v1 *v1_entries;
>         size_t size, max, entry_size, entries_size;
>         efi_memory_desc_t md;
>         int rc;
> @@ -288,14 +287,13 @@ void __init efi_esrt_init(void)
>         memcpy(&tmpesrt, va, sizeof(tmpesrt));
>         early_memunmap(va, size);
>
> -       if (tmpesrt.fw_resource_version == 1) {
> -               entry_size = sizeof (*v1_entries);
> -       } else {
> +       if (tmpesrt.fw_resource_version != 1) {
>                 pr_err("Unsupported ESRT version %lld.\n",
>                        tmpesrt.fw_resource_version);
>                 return;
>         }
>
> +       entry_size = sizeof(struct efi_system_resource_entry_v1);
>         if (tmpesrt.fw_resource_count > 0 && max - size < entry_size) {
>                 pr_err("ESRT memory map entry can only hold the header. (max: %zu size: %zu)\n",
>                        max - size, entry_size);
> --
> 2.25.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-23 20:45 [PATCH 1/1] efi/esrt: unused variable in __init efi_esrt_init Heinrich Schuchardt
2020-02-23 21:24 ` Ard Biesheuvel

Linux-EFI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-efi/0 linux-efi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-efi linux-efi/ https://lore.kernel.org/linux-efi \
		linux-efi@vger.kernel.org
	public-inbox-index linux-efi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-efi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git