From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH] bpf/test_run: Add braces to initialization in bpf_prog_test_run_skb Date: Fri, 19 Oct 2018 11:46:24 -0700 Message-ID: <3e2e5343-3ead-5b4d-758d-14f04183b39e@gmail.com> References: <20181019182649.24301-1-natechancellor@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Nathan Chancellor , Alexei Starovoitov , Daniel Borkmann Return-path: In-Reply-To: <20181019182649.24301-1-natechancellor@gmail.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 10/19/2018 11:26 AM, Nathan Chancellor wrote: > Clang warns: > > net/bpf/test_run.c:120:20: error: suggest braces around initialization > of subobject [-Werror,-Wmissing-braces] > struct sock sk = {0}; > ^ > {} > > Add the braces to properly initialize all subobjects. > > Fixes: 75079847e9d0 ("bpf: add tests for direct packet access from CGROUP_SKB") > Signed-off-by: Nathan Chancellor > --- > net/bpf/test_run.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c > index 8dccac305268..65e049c61a7a 100644 > --- a/net/bpf/test_run.c > +++ b/net/bpf/test_run.c > @@ -117,7 +117,7 @@ int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr, > u32 retval, duration; > int hh_len = ETH_HLEN; > struct sk_buff *skb; > - struct sock sk = {0}; > + struct sock sk = { { {0} } }; > void *data; > int ret; > > Strange, I thought this patch was still under discussion. Has an old version of it being merged somewhere ?