netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Salah Triki <salah.triki@gmail.com>
To: kevin.curtis@farsite.co.uk, davem@davemloft.net, kuba@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] replace for loop with array initializer
Date: Mon, 12 Jul 2021 20:24:50 +0100	[thread overview]
Message-ID: <20210712192450.GA1153790@pc> (raw)

Replace for loop with array initializer in order to make code more clean.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
 drivers/net/wan/farsync.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index b3466e084e84..a90d3b9a8170 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -567,7 +567,7 @@ static void fst_process_int_work_q(struct tasklet_struct *unused);
 static DECLARE_TASKLET(fst_tx_task, fst_process_tx_work_q);
 static DECLARE_TASKLET(fst_int_task, fst_process_int_work_q);
 
-static struct fst_card_info *fst_card_array[FST_MAX_CARDS];
+static struct fst_card_info *fst_card_array[FST_MAX_CARDS] = { [0 ... FST_MAX_CARDS-1] = NULL };
 static DEFINE_SPINLOCK(fst_work_q_lock);
 static u64 fst_work_txq;
 static u64 fst_work_intq;
@@ -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


             reply	other threads:[~2021-07-12 19:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 19:24 Salah Triki [this message]
2021-07-12 20:05 ` [PATCH] replace for loop with array initializer Stephen Hemminger
2021-07-14  4:08   ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210712192450.GA1153790@pc \
    --to=salah.triki@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kevin.curtis@farsite.co.uk \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).