2020-02-23 22:13:56

by Heinrich Schuchardt

[permalink] [raw]
Subject: [PATCH 1/1] efi: don't shadow i in efi_config_parse_tables()

Shadowing variables is generally frowned upon.

Let's simply reuse the existing loop counter i instead of shadowing it.

Signed-off-by: Heinrich Schuchardt <[email protected]>
---
drivers/firmware/efi/efi.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 69a585106d30..d0c7f4c1db31 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -553,7 +553,6 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables,
while (prsv) {
struct linux_efi_memreserve *rsv;
u8 *p;
- int i;

/*
* Just map a full page: that is what we will get
--
2.25.0


2020-02-26 17:08:03

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH 1/1] efi: don't shadow i in efi_config_parse_tables()

On Sun, 23 Feb 2020 at 23:13, Heinrich Schuchardt <[email protected]> wrote:
>
> Shadowing variables is generally frowned upon.
>
> Let's simply reuse the existing loop counter i instead of shadowing it.
>
> Signed-off-by: Heinrich Schuchardt <[email protected]>

Queued in efi/next, thanks.

> ---
> drivers/firmware/efi/efi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 69a585106d30..d0c7f4c1db31 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -553,7 +553,6 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables,
> while (prsv) {
> struct linux_efi_memreserve *rsv;
> u8 *p;
> - int i;
>
> /*
> * Just map a full page: that is what we will get
> --
> 2.25.0
>