From: Stephen Hemminger <stephen@networkplumber.org>
To: Salah Triki <salah.triki@gmail.com>
Cc: kevin.curtis@farsite.co.uk, davem@davemloft.net, kuba@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] replace for loop with array initializer
Date: Mon, 12 Jul 2021 13:05:20 -0700 [thread overview]
Message-ID: <20210712130520.748b6e3a@hermes.local> (raw)
In-Reply-To: <20210712192450.GA1153790@pc>
On Mon, 12 Jul 2021 20:24:50 +0100
Salah Triki <salah.triki@gmail.com> wrote:
> 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 };
Why bother, the default initialization in C is 0 (ie. NULL).
In fact, checkpatch should complain about useless array initialization for this.
next prev parent reply other threads:[~2021-07-12 20:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-12 19:24 [PATCH] replace for loop with array initializer Salah Triki
2021-07-12 20:05 ` Stephen Hemminger [this message]
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=20210712130520.748b6e3a@hermes.local \
--to=stephen@networkplumber.org \
--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 \
--cc=salah.triki@gmail.com \
/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).