diff mbox series

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

Message ID 20180402232414.19671-1-f.fainelli@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net] net: dsa: mt7530: Use NULL instead of plain integer | expand

Commit Message

Florian Fainelli April 2, 2018, 11:24 p.m. UTC
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")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/mt7530.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sean Wang April 3, 2018, 2:18 a.m. UTC | #1
On Mon, 2018-04-02 at 16:24 -0700, Florian Fainelli wrote:
> We would be passing 0 instead of NULL as the rsp argument to
> mt7530_fdb_cmd(), fix that.
> 

Acked-by: Sean Wang <sean.wang@mediatek.com>

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


> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/net/dsa/mt7530.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> index 4e53c5ce23ff..a7f6c0a62fc7 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -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;
>
Florian Fainelli April 3, 2018, 5:02 p.m. UTC | #2
On 04/02/2018 07:18 PM, Sean Wang wrote:
> On Mon, 2018-04-02 at 16:24 -0700, Florian Fainelli wrote:
>> We would be passing 0 instead of NULL as the rsp argument to
>> mt7530_fdb_cmd(), fix that.
>>
> 
> Acked-by: Sean Wang <sean.wang@mediatek.com>
> 
> 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?
Sean Wang April 3, 2018, 5:31 p.m. UTC | #3
On Tue, 2018-04-03 at 10:02 -0700, Florian Fainelli wrote:
> On 04/02/2018 07:18 PM, Sean Wang wrote:
> > On Mon, 2018-04-02 at 16:24 -0700, Florian Fainelli wrote:
> >> We would be passing 0 instead of NULL as the rsp argument to
> >> mt7530_fdb_cmd(), fix that.
> >>
> > 
> > Acked-by: Sean Wang <sean.wang@mediatek.com>
> > 
> > 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
David Miller April 4, 2018, 3:16 p.m. UTC | #4
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon,  2 Apr 2018 16:24:14 -0700

> 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")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 4e53c5ce23ff..a7f6c0a62fc7 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -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;