Re: [PATCH net] net: switchdev: zero-initialize struct switchdev_notifier_fdb_info emitted by drivers towards the bridge

From
Vladimir Oltean <vladimir.oltean@nxp.com>
Date
2021-08-10 08:16:29
Also in
linux-omap, linux-rdma, linux-s390, lkml, netdev
Reply to
Leon Romanovsky, 2021-08-10
Hi Leon,

On Tue, Aug 10, 2021 at 09:50:41AM +0300, Leon Romanovsky wrote:
quoted
+	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.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (6 messages) 6 messages, 4 authors, last reply 2021-08-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help