Skip to content

Commit ed43fba

Browse files
rleondavem330
authored andcommitted
devlink: Clear whole devlink_flash_notify struct
The { 0 } doesn't clear all fields in the struct, but tells to the compiler to set all fields to zero and doesn't touch any sub-fields if they exists. The {} is an empty initialiser that instructs to fully initialize whole struct including sub-fields, which is error-prone for future devlink_flash_notify extensions. Fixes: 6700acc ("devlink: collect flash notify params into a struct") Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 11a861d commit ed43fba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/core/devlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,7 +4169,7 @@ static void __devlink_flash_update_notify(struct devlink *devlink,
41694169

41704170
static void devlink_flash_update_begin_notify(struct devlink *devlink)
41714171
{
4172-
struct devlink_flash_notify params = { 0 };
4172+
struct devlink_flash_notify params = {};
41734173

41744174
__devlink_flash_update_notify(devlink,
41754175
DEVLINK_CMD_FLASH_UPDATE,
@@ -4178,7 +4178,7 @@ static void devlink_flash_update_begin_notify(struct devlink *devlink)
41784178

41794179
static void devlink_flash_update_end_notify(struct devlink *devlink)
41804180
{
4181-
struct devlink_flash_notify params = { 0 };
4181+
struct devlink_flash_notify params = {};
41824182

41834183
__devlink_flash_update_notify(devlink,
41844184
DEVLINK_CMD_FLASH_UPDATE_END,

0 commit comments

Comments
 (0)