mlxsw: spectrum_span: Fix initialization of struct mlxsw_sp_span_parms
authorPetr Machata <petrm@mellanox.com>
Thu, 22 Mar 2018 18:14:47 +0000 (20:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Mar 2018 16:59:26 +0000 (12:59 -0400)
Since the first element of struct mlxsw_sp_span_parms is a pointer,
to zero-initialize this structure the correct notation is not = {0}, but
rather = {NULL}, as reported by sparse.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c

index ae22a3daffbf54781c249e792510ab6bbf38462a..ac24e52d74db1d362cd6770d6a7a2a9ccbf6733c 100644 (file)
@@ -730,7 +730,7 @@ int mlxsw_sp_span_mirror_add(struct mlxsw_sp_port *from,
 {
        struct mlxsw_sp *mlxsw_sp = from->mlxsw_sp;
        const struct mlxsw_sp_span_entry_ops *ops;
-       struct mlxsw_sp_span_parms sparms = {0};
+       struct mlxsw_sp_span_parms sparms = {NULL};
        struct mlxsw_sp_span_entry *span_entry;
        int err;
 
@@ -787,7 +787,7 @@ void mlxsw_sp_span_respin(struct mlxsw_sp *mlxsw_sp)
        ASSERT_RTNL();
        for (i = 0; i < mlxsw_sp->span.entries_count; i++) {
                struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i];
-               struct mlxsw_sp_span_parms sparms = {0};
+               struct mlxsw_sp_span_parms sparms = {NULL};
 
                if (!curr->ref_count)
                        continue;