[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180322181447.27554-1-idosch@mellanox.com>
Date: Thu, 22 Mar 2018 20:14:47 +0200
From: Ido Schimmel <idosch@...lanox.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, petrm@...lanox.com, jiri@...lanox.com,
mlxsw@...lanox.com, Ido Schimmel <idosch@...lanox.com>
Subject: [PATCH net-next] mlxsw: spectrum_span: Fix initialization of struct mlxsw_sp_span_parms
From: Petr Machata <petrm@...lanox.com>
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@...lanox.com>
Acked-by: Jiri Pirko <jiri@...lanox.com>
Signed-off-by: Ido Schimmel <idosch@...lanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
index ae22a3daffbf..ac24e52d74db 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
@@ -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;
--
2.14.3
Powered by blists - more mailing lists