Re: [PATCH] net: ethernet: mscc: fix missing brace warning for old compilers

2020-11-02 Thread Vladimir Oltean
On Mon, Nov 02, 2020 at 02:08:08PM -0800, Jakub Kicinski wrote: > Old GCC does not like the 0, if the members of struct are not scalars. > > struct ocelot_vcap_u16 { > u8 value[2]; > u8 mask[2]; > }; > > In this case the first member is an array. > > It wants us to add another curly

Re: [PATCH] net: ethernet: mscc: fix missing brace warning for old compilers

2020-11-02 Thread Jakub Kicinski
On Mon, 2 Nov 2020 13:56:55 + 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/oce

Re: [PATCH] net: ethernet: mscc: fix missing brace warning for old compilers

2020-11-02 Thread David Sterba
On Mon, Nov 02, 2020 at 01:56:55PM +, 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/

Re: [PATCH] net: ethernet: mscc: fix missing brace warning for old compilers

2020-11-02 Thread Vladimir Oltean
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 [-