Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3467308pxx; Mon, 2 Nov 2020 09:36:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBgJ4dzid+TSho1gVhyLLtqy9b8xySgfGlyfCH6aNuK4dJYFEyFS2kQLaH0+rM2Xv3E5ut X-Received: by 2002:a17:906:3641:: with SMTP id r1mr17306633ejb.391.1604338579953; Mon, 02 Nov 2020 09:36:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604338579; cv=none; d=google.com; s=arc-20160816; b=Sg1ky8We1sGyLZGGRixd4XMq6sHiEYYNFjLUCyYa+6EJ4Yk543VrA5K82PPMVxBJ6G 0+jAVC50RAOMmoW76taTQ9so5fPPElKaBllu34lijcHmI4GHJXk7oFbTm0cUrwxF0sD1 ODYplcycJxH2gwZSGvMjAnpJmW3+d8bIOkwavqKadzsocWi0LRmKt/gnw71rk2rDG1oH SrBbluJIcQ2klpcbFLUgrh2n+xFNslECceWEGeq4cL1SqOVSGbtMHfa+W3pjZO93v90N k1qbDYL7Yza1wlQiYSTP6jgtS1ElUOwY5N9hzqiCebRsv424yRXc6RUN0xXyFYWRAC0z +9dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date; bh=zgC6Mabc47H9tqDkdjmovqKDmaRFyLaC7ZkCRtmQWA4=; b=qW3CW9R3bCxaWNErl9RSMgF9TpHwxbPaK0URkDWt7lwCXF3LCd1DJrlajbLa/rULMV tpp8hZ/S5tc6pZydB4W6gCnfkAJqL0fS4Gh9FZG2k4CuVwrEpp9pTGTtzjY72ID578lw Bx4DZYyjFaEHLYzipNveRuzHukLBvCYC7j4Nb4D8zcpBdZyFJ9yJCl4TnFSOkzYZ7TvU lrVomjRSQUneAguhQRlNo51SGz3VAQZslxNsTjigF/GnMLKSllYwjWmm6YZpdlihil3f hj47LLh+7boGnXXUVAR22YV4cIoXhyD/DjMrOerDuc54e8dHQga6BaFJZ2+8eeTMwIkF DDkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si11257326ejy.607.2020.11.02.09.35.56; Mon, 02 Nov 2020 09:36:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727812AbgKBRec (ORCPT + 99 others); Mon, 2 Nov 2020 12:34:32 -0500 Received: from mx2.suse.de ([195.135.220.15]:54476 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727227AbgKBReb (ORCPT ); Mon, 2 Nov 2020 12:34:31 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E1E56AC6A; Mon, 2 Nov 2020 17:34:29 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 5EFE7DA7D2; Mon, 2 Nov 2020 18:32:52 +0100 (CET) Date: Mon, 2 Nov 2020 18:32:50 +0100 From: David Sterba To: Vladimir Oltean Cc: Pujin Shi , Jakub Kicinski , "David S . Miller" , Microchip Linux Driver Support , Claudiu Manoil , Alexandre Belloni , Xiaoliang Yang , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] net: ethernet: mscc: fix missing brace warning for old compilers Message-ID: <20201102173250.GJ6756@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Vladimir Oltean , Pujin Shi , Jakub Kicinski , "David S . Miller" , Microchip Linux Driver Support , Claudiu Manoil , Alexandre Belloni , Xiaoliang Yang , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20201102134136.2565-1-shipujin.t@gmail.com> <20201102135654.gs2fa7q2y3i3sc5k@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201102135654.gs2fa7q2y3i3sc5k@skbuf> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 02, 2020 at 01:56:55PM +0000, Vladimir Oltean wrote: > On Mon, Nov 02, 2020 at 09:41:36PM +0800, Pujin Shi wrote: > > For older versions of gcc, the array = {0}; will cause warnings: > > > > drivers/net/ethernet/mscc/ocelot_vcap.c: In function 'is1_entry_set': > > drivers/net/ethernet/mscc/ocelot_vcap.c:755:11: warning: missing braces around initializer [-Wmissing-braces] > > struct ocelot_vcap_u16 etype = {0}; > > ^ > > drivers/net/ethernet/mscc/ocelot_vcap.c:755:11: warning: (near initialization for 'etype.value') [-Wmissing-braces] > > > > 1 warnings generated > > > > Fixes: 75944fda1dfe ("net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1") > > Signed-off-by: Pujin Shi > > --- > > drivers/net/ethernet/mscc/ocelot_vcap.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/net/ethernet/mscc/ocelot_vcap.c b/drivers/net/ethernet/mscc/ocelot_vcap.c > > index d8c778ee6f1b..b96eab4583e7 100644 > > --- a/drivers/net/ethernet/mscc/ocelot_vcap.c > > +++ b/drivers/net/ethernet/mscc/ocelot_vcap.c > > @@ -752,7 +752,7 @@ static void is1_entry_set(struct ocelot *ocelot, int ix, > > dport); > > } else { > > /* IPv4 "other" frame */ > > - struct ocelot_vcap_u16 etype = {0}; > > + struct ocelot_vcap_u16 etype = {}; > > > > /* Overloaded field */ > > etype.value[0] = proto.value[0]; > > Sorry, I don't understand what the problem is, or why your patch fixes > it. What version of gcc are you testing with? Nothing wrong and { 0 } is the right initializer, the reports must be from some ancient gcc but we weren't told which one either. https://lore.kernel.org/linux-btrfs/fbddb15a-6e46-3f21-23ba-b18f66e3448a@suse.com/