[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210810081616.wjx6jnlh3qxqsfm2@skbuf>
Date: Tue, 10 Aug 2021 08:16:17 +0000
From: Vladimir Oltean <vladimir.oltean@....com>
To: Leon Romanovsky <leon@...nel.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Vadym Kochan <vkochan@...vell.com>,
Taras Chornyi <tchornyi@...vell.com>,
Saeed Mahameed <saeedm@...dia.com>,
Jiri Pirko <jiri@...dia.com>, Ido Schimmel <idosch@...dia.com>,
Lars Povlsen <lars.povlsen@...rochip.com>,
Steen Hegelund <Steen.Hegelund@...rochip.com>,
"UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
Grygorii Strashko <grygorii.strashko@...com>,
Julian Wiedmann <jwi@...ux.ibm.com>,
Karsten Graul <kgraul@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
Jianbo Liu <jianbol@...dia.com>,
Vlad Buslov <vladbu@...dia.com>,
Bjarni Jonasson <bjarni.jonasson@...rochip.com>,
Vignesh Raghavendra <vigneshr@...com>,
Tobias Waldekranz <tobias@...dekranz.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
Ido Schimmel <idosch@...sch.org>
Subject: Re: [PATCH net] net: switchdev: zero-initialize struct
switchdev_notifier_fdb_info emitted by drivers towards the bridge
Hi Leon,
On Tue, Aug 10, 2021 at 09:50:41AM +0300, Leon Romanovsky wrote:
> > + memset(&send_info, 0, sizeof(send_info));
>
> This can be written simpler.
> struct switchdev_notifier_fdb_info send_info = {};
>
> In all places.
Because the structure contains a sub-structure, I believe that a
compound literal initializer would require additional braces for the
initialization of its sub-objects too. At least I know that expressions
like that have attracted the attention of clang people in the past:
https://patchwork.ozlabs.org/project/netdev/patch/20190506202447.30907-1-natechancellor@gmail.com/
So I went for the 'unambiguous' path.
Powered by blists - more mailing lists