Thread (3 messages) flat view 3 messages, 3 authors, 2021-07-14

Re: [PATCH] replace for loop with array initializer

From: Joe Perches <joe@perches.com>
Date: 2021-07-14 04:08:26
Also in: lkml

On Mon, 2021-07-12 at 13:05 -0700, Stephen Hemminger wrote:
On Mon, 12 Jul 2021 20:24:50 +0100 Salah Triki [off-list ref] wrote:
quoted
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
[]
quoted
+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.
I'll look out for your patch to checkpatch.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help