2021-07-12 20:59:49

by Salah Triki

[permalink] [raw]
Subject: [PATCH] delete useless for loop

Delete useless initialization of fst_card_array since the default
initialization is NULL.

Signed-off-by: Salah Triki <[email protected]>
---
drivers/net/wan/farsync.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index b3466e084e84..0b3f561d5d5e 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2565,10 +2565,6 @@ static struct pci_driver fst_driver = {
static int __init
fst_init(void)
{
- int i;
-
- for (i = 0; i < FST_MAX_CARDS; i++)
- fst_card_array[i] = NULL;
return pci_register_driver(&fst_driver);
}

--
2.25.1


2021-07-13 06:43:22

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH] delete useless for loop

Hello Salah,

On Mon, Jul 12, 2021 at 09:58:48PM +0100, Salah Triki wrote:
> Delete useless initialization of fst_card_array since the default
> initialization is NULL.
>
> Signed-off-by: Salah Triki <[email protected]>
> ---
> drivers/net/wan/farsync.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
> index b3466e084e84..0b3f561d5d5e 100644
> --- a/drivers/net/wan/farsync.c
> +++ b/drivers/net/wan/farsync.c
> @@ -2565,10 +2565,6 @@ static struct pci_driver fst_driver = {
> static int __init
> fst_init(void)
> {
> - int i;
> -
> - for (i = 0; i < FST_MAX_CARDS; i++)
> - fst_card_array[i] = NULL;
> return pci_register_driver(&fst_driver);
> }

Looks right. I wonder if it makes sense to go even further and let
farsync.c use module_pci_driver.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |


Attachments:
(No filename) (1.01 kB)
signature.asc (499.00 B)
Download all attachments