lkml.org 
[lkml]   [2020]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] net: ethernet: mscc: fix missing brace warning for old compilers
Date
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..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];
--
2.18.1
\
 
 \ /
  Last update: 2020-11-02 14:42    [W:0.053 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site