Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp737594pxb; Tue, 3 Nov 2020 11:07:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3xmLZdjwdiGPE7YKuguQ38coLGbuXlXdMzVxMUPPaO0rgqF9XxWaZyxDpZQXKuDOp/dMm X-Received: by 2002:a17:906:4807:: with SMTP id w7mr12591657ejq.306.1604430422514; Tue, 03 Nov 2020 11:07:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604430422; cv=none; d=google.com; s=arc-20160816; b=nfBYwFFFBGzf97dcazbQewADka8f04S/F65IgEjh1HnGtClm71Xdhb+jvRCb2JzYc8 dZyBbjWgGAv+etnEVbq15NCe5u8rU8mVg7280rfnRfgI6M5tmiNy4tRs1FRMLobFFGYG 8XC9nOGZ/GsqlKGxtHXvhdQwr517fv57YmTP0xTD5P4GzyrEuK267rrM2RIxYXLZnCrH IBkOB97BG0IBS4j8WP51wLZprBWRk4IdL79swjsa/2jdIDSBpqSD3lyBz2P9AVm5lwpR xDQyyzk5LwLhETrr+N9K3d3PJRnsRKTVWbg0A3ZwfoagLyeEfF95NoMcQ04B8xchgj13 Ukaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ctoM8hLkpu9g6i/DjmYcXNh0pxuTLJvf0rKlUgLGsc0=; b=uo6/2FlI10G3oGdOTC3Y0brv8W+o0Tduc4L11/hHIeUs0e30H2mh490mpBQgJtumkw WLbiRgTHcsZUem+AC0AjBFnTO98iHULAGIDXz8af2+22XKFfWw5A7f8N35vltfqN7DVb HyPCTpl23Iq1H1Tt6T1/v8/NsRdqSF7jSSBCZ9jpH4NHYhU5Wi2Us9NtakyO02SnwmEI sGaXxGSISsyuIAsZJPVNzGIIenl3WJ5YrSRCvcjH5cYHbXZTunI42HklrCgYMuqLiaI0 BozGKYWi6qTaMBWzctX/kL/3q4v4p8Mc4Q62WUuTS0gxROmzP+daRXueXA92jXTOe6O9 0srA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="a6P/R/AS"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr18si13337745ejb.45.2020.11.03.11.06.38; Tue, 03 Nov 2020 11:07:02 -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; dkim=pass header.i=@kernel.org header.s=default header.b="a6P/R/AS"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729580AbgKCTFO (ORCPT + 99 others); Tue, 3 Nov 2020 14:05:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:55376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729391AbgKCTFM (ORCPT ); Tue, 3 Nov 2020 14:05:12 -0500 Received: from kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net (unknown [163.114.132.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C46452074B; Tue, 3 Nov 2020 19:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604430311; bh=FcUM5b5zIIcbNgSiyZrMSCtOG1CxHKvZpGQJoyIJf2E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=a6P/R/ASD6vLJQ3ct2QW51s1KD4lzM81aydDN53dHoRkNQoUwL4sYLyIsWxJsgHSW wTvkl6RXHOG6YlOmf8Z5R3YBlZ7IsWfdhuo1rxDbDhrvlHQFjaim+NPzSWmijE0jR0 DEpGwnxWW6KJawvko8qi55at5hyOmUoqHsqb1s7k= Date: Tue, 3 Nov 2020 11:05:09 -0800 From: Jakub Kicinski To: Pujin Shi Cc: "David S . Miller" , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Xiaoliang Yang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] net: ethernet: mscc: fix missing brace warning for old compilers Message-ID: <20201103110509.6bb18273@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: <20201103025519.1916-1-shipujin.t@gmail.com> References: <20201103025519.1916-1-shipujin.t@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Nov 2020 10:55:19 +0800 Pujin Shi wrote: > For older versions of gcc, the array = {0}; will cause warnings: Please include the version of gcc which generates this warning here. > 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..b5167570521c 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 = {{0}}; I believe Vladimir asked to use a memset instead; struct ocelot_vcap_u16 etype; memset(&etype, 0, sizeof(etype)); > /* Overloaded field */ > etype.value[0] = proto.value[0];