Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] delete useless for loop
@ 2021-07-12 20:58 Salah Triki
2021-07-13 6:41 ` Uwe Kleine-König
0 siblings, 1 reply; 2+ messages in thread
From: Salah Triki @ 2021-07-12 20:58 UTC (permalink / raw)
To: kevin.curtis, davem, kuba, stephen; +Cc: netdev, linux-kernel
Delete useless initialization of fst_card_array since the default
initialization is NULL.
Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] delete useless for loop
2021-07-12 20:58 [PATCH] delete useless for loop Salah Triki
@ 2021-07-13 6:41 ` Uwe Kleine-König
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2021-07-13 6:41 UTC (permalink / raw)
To: Salah Triki; +Cc: kevin.curtis, davem, kuba, stephen, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]
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 <salah.triki@gmail.com>
> ---
> 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/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-13 6:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12 20:58 [PATCH] delete useless for loop Salah Triki
2021-07-13 6:41 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).