lkml.org 
[lkml]   [2021]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] replace for loop with array initializer
From
Date
On Mon, 2021-07-12 at 13:05 -0700, Stephen Hemminger wrote:
> 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
[]
> > +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.


\
 
 \ /
  Last update: 2021-07-14 06:08    [W:0.029 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site