Skip to contentSkip to conversation

net: dsa: mt7530: Use NULL instead of plain integer

PATCH Applied Florian Fainelli 3 participants 5 messages Apr 2, 2018 – Apr 4, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: mt7530: Use NULL instead of plain integer

We would be passing 0 instead of NULL as the rsp argument to mt7530_fdb_cmd(), fix that.

Fixes b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
---
 drivers/net/dsa/mt7530.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/dsa/mt7530.c +3 -3
index 4e53c5ce23ff..a7f6c0a62fc7 100644
@@ -917,7 +917,7 @@ mt7530_port_fdb_add(struct dsa_switch *ds, int port,
 
 	mutex_lock(&priv->reg_mutex);
 	mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_ENT);
-	ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, 0);
+	ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, NULL);
 	mutex_unlock(&priv->reg_mutex);
 
 	return ret;
@@ -933,7 +933,7 @@ mt7530_port_fdb_del(struct dsa_switch *ds, int port,
 
 	mutex_lock(&priv->reg_mutex);
 	mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_EMP);
-	ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, 0);
+	ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, NULL);
 	mutex_unlock(&priv->reg_mutex);
 
 	return ret;
@@ -1293,7 +1293,7 @@ mt7530_setup(struct dsa_switch *ds)
 	}
 
 	/* Flush the FDB table */
-	ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, 0);
+	ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
 	if (ret < 0)
 		return ret;
 
Signature · 1 line
2.14.1
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Florian Fainelli

We would be passing 0 instead of NULL as the rsp argument to mt7530_fdb_cmd(), fix that.

BTW, does the part of the commit message should be updated with "passing NULL instead of 0"?

Quoted 37 lines
Fixes b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
---
 drivers/net/dsa/mt7530.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/dsa/mt7530.c +3 -3
index 4e53c5ce23ff..a7f6c0a62fc7 100644
@@ -917,7 +917,7 @@ mt7530_port_fdb_add(struct dsa_switch *ds, int port,
 
 	mutex_lock(&priv->reg_mutex);
 	mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_ENT);
-	ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, 0);
+	ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, NULL);
 	mutex_unlock(&priv->reg_mutex);
 
 	return ret;
@@ -933,7 +933,7 @@ mt7530_port_fdb_del(struct dsa_switch *ds, int port,
 
 	mutex_lock(&priv->reg_mutex);
 	mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_EMP);
-	ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, 0);
+	ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, NULL);
 	mutex_unlock(&priv->reg_mutex);
 
 	return ret;
@@ -1293,7 +1293,7 @@ mt7530_setup(struct dsa_switch *ds)
 	}
 
 	/* Flush the FDB table */
-	ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, 0);
+	ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
 	if (ret < 0)
 		return ret;
 
#2 lore raw
Quoted 9 lines · Sean Wang
Quoted 3 lines · Florian Fainelli

We would be passing 0 instead of NULL as the rsp argument to mt7530_fdb_cmd(), fix that.

BTW, does the part of the commit message should be updated with "passing NULL instead of 0"?

I don't follow you, the commit message indicates what we were doing which implies it was wrong and fixes it. Would you want me to reword that part?

Signature · 1 line
Florian
#3 lore raw
Quoted 6 lines · Florian Fainelli
Quoted 5 lines · Sean Wang
Quoted 3 lines · Florian Fainelli

We would be passing 0 instead of NULL as the rsp argument to mt7530_fdb_cmd(), fix that.

Quoted 8 lines
Quoted 4 lines

BTW, does the part of the commit message should be updated with "passing NULL instead of 0"?

I don't follow you, the commit message indicates what we were doing which implies it was wrong and fixes it. Would you want me to reword that part?

thanks for the explanation.

the commit message is clear and okay for me now