Skip to contentSkip to conversation

mlxsw: spectrum_dpipe: Fix sparse warnings

PATCH Applied Jiri Pirko 2 participants 2 messages May 18, 2017

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 mlxsw: spectrum_dpipe: Fix sparse warnings

From: Arkadi Sharshevsky <[email protected]>

drivers/net/ethernet/mellanox/mlxsw//spectrum_dpipe.c:221:52: warning:
Using plain integer as NULL pointer drivers/net/ethernet/mellanox/mlxsw//spectrum_dpipe.c:221:74: warning:
Using plain integer as NULL pointer

---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c +4 -1
index ce2534d..096212d 100644
@@ -217,7 +217,7 @@ static int
 mlxsw_sp_table_erif_entries_dump(void *priv, bool counters_enabled,
 				 struct devlink_dpipe_dump_ctx *dump_ctx)
 {
-	struct devlink_dpipe_value match_value = {{0}}, action_value = {{0}};
+	struct devlink_dpipe_value match_value, action_value;
 	struct devlink_dpipe_action action = {0};
 	struct devlink_dpipe_match match = {0};
 	struct devlink_dpipe_entry entry = {0};
@@ -226,6 +226,9 @@ mlxsw_sp_table_erif_entries_dump(void *priv, bool counters_enabled,
 	int i, j;
 	int err;
 
+	memset(&match_value, 0, sizeof(match_value));
+	memset(&action_value, 0, sizeof(action_value));
+
 	mlxsw_sp_erif_match_action_prepare(&match, &action);
 	err = mlxsw_sp_erif_entry_prepare(&entry, &match_value, &match,
 					  &action_value, &action);
Signature · 1 line
2.9.3
maintainer Applied
#1 lore raw

From: Jiri Pirko <[email protected]>
Date: Thu, 18 May 2017 09:22:45 +0200

Quoted 10 lines

From: Arkadi Sharshevsky <[email protected]>

drivers/net/ethernet/mellanox/mlxsw//spectrum_dpipe.c:221:52: warning:
Using plain integer as NULL pointer drivers/net/ethernet/mellanox/mlxsw//spectrum_dpipe.c:221:74: warning:
Using plain integer as NULL pointer

Applied.