lkml.org 
[lkml]   [2018]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next v2] geneve: Use empty braces for addr6 initializer
From
Date
On Fri, 2018-11-16 at 08:37 -0700, Nathan Chancellor wrote:
> On Fri, Nov 16, 2018 at 03:04:32PM +0100, Stefano Brivio wrote:
> > On Mon, 12 Nov 2018 23:11:47 -0700
> > Nathan Chancellor <natechancellor@gmail.com> wrote:
> >
> > > Clang warns:
> > >
> > > drivers/net/geneve.c:428:29: error: suggest braces around initialization
> > > of subobject [-Werror,-Wmissing-braces]
> > > struct in6_addr addr6 = { 0 };
> > > ^
> > > {}
> > >
> > > Most initializations of structs in the kernel seem to use this format.
[]
> > So { { { 0 } } } seems to be the safest option. We could go with static
> > but it looks even uglier to me.
> >
> > Joe, suggestions?

If this is really an issue, I don't know why the other uses
haven't been reported. Perhaps change the rest of them too?

$ git grep -P "struct\s+in6_addr\s+\w+\s*=\s*{\s*}"
include/net/ip6_fib.h: struct in6_addr in6_zero = {};
include/trace/events/fib6.h: struct in6_addr in6_zero = {};
net/6lowpan/iphc.c: struct in6_addr network_pfx = {};
net/6lowpan/iphc.c: struct in6_addr tmp = {};
net/6lowpan/iphc.c: struct in6_addr tmp = {};
net/6lowpan/iphc.c: struct in6_addr tmp = {};
net/6lowpan/iphc.c: struct in6_addr tmp = {};



\
 
 \ /
  Last update: 2018-11-17 03:35    [W:2.085 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site