Thread (6 messages) 6 messages, 4 authors, 2021-08-10

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 09:35:05
Also in: linux-arm-kernel, linux-rdma, linux-s390, lkml, netdev

On Tue, Aug 10, 2021 at 10:12:38AM +0100, Russell King - ARM Linux admin wrote:
There's a difference between:

	struct foo bar = { 0 };

and

	struct foo bar = { };

The former tells the compiler that you wish to set the first member of
struct foo, which will be an integer type, to zero. The latter is an
empty initialiser where all members and sub-members of the structure
default to a zero value.

You should have no problem with the latter. You will encounter problems
with the former if the first member of struct foo is not an integer
type.
Ok, that's good to know. Seeing that this patch has not been applied yet
I'll go for a v2.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help