netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] mlxsw: spectrum_span: Fix initialization of struct mlxsw_sp_span_parms
@ 2018-03-22 18:14 Ido Schimmel
  2018-03-23 17:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ido Schimmel @ 2018-03-22 18:14 UTC (permalink / raw)
  To: netdev; +Cc: davem, petrm, jiri, mlxsw, Ido Schimmel

From: Petr Machata <petrm@mellanox.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@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] mlxsw: spectrum_span: Fix initialization of struct mlxsw_sp_span_parms
  2018-03-22 18:14 [PATCH net-next] mlxsw: spectrum_span: Fix initialization of struct mlxsw_sp_span_parms Ido Schimmel
@ 2018-03-23 17:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-03-23 17:00 UTC (permalink / raw)
  To: idosch; +Cc: netdev, petrm, jiri, mlxsw

From: Ido Schimmel <idosch@mellanox.com>
Date: Thu, 22 Mar 2018 20:14:47 +0200

> From: Petr Machata <petrm@mellanox.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@mellanox.com>
> Acked-by: Jiri Pirko <jiri@mellanox.com>
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-23 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 18:14 [PATCH net-next] mlxsw: spectrum_span: Fix initialization of struct mlxsw_sp_span_parms Ido Schimmel
2018-03-23 17:00 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).