From: Pujin Shi <shipujin.t@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>
Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Pujin Shi <shipujin.t@gmail.com>
Subject: [PATCH V2] net: ethernet: mscc: fix missing brace warning for old compilers
Date: Tue, 3 Nov 2020 10:55:19 +0800 [thread overview]
Message-ID: <20201103025519.1916-1-shipujin.t@gmail.com> (raw)
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 <shipujin.t@gmail.com>
---
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}};
/* Overloaded field */
etype.value[0] = proto.value[0];
--
2.18.1
next reply other threads:[~2020-11-03 2:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 2:55 Pujin Shi [this message]
2020-11-03 19:05 ` [PATCH V2] net: ethernet: mscc: fix missing brace warning for old compilers Jakub Kicinski
2020-11-03 19:26 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201103025519.1916-1-shipujin.t@gmail.com \
--to=shipujin.t@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vladimir.oltean@nxp.com \
--cc=xiaoliang.yang_1@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).