From: Vladimir Oltean <vladimir.oltean@nxp.com> Date: 2021-07-30 22:57:33
It is desirable to reduce the surface of DSA_TAG_PROTO_NONE as much as
we can, because we now have options for switches without hardware
support for DSA tagging, and the occurrence in the mt7530 driver is in
fact quite gratuitout and easy to remove. Since ds->ops->get_tag_protocol()
is only called for CPU ports, the checks for a CPU port in
mtk_get_tag_protocol() are redundant and can be removed.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/dsa/mt7530.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
@@ -1717,15 +1717,7 @@ static enum dsa_tag_protocolmtk_get_tag_protocol(structdsa_switch*ds,intport,enumdsa_tag_protocolmp){-structmt7530_priv*priv=ds->priv;--if(port!=MT7530_CPU_PORT){-dev_warn(priv->dev,-"port not matched with tagging CPU port\n");-returnDSA_TAG_PROTO_NONE;-}else{-returnDSA_TAG_PROTO_MTK;-}+returnDSA_TAG_PROTO_MTK;}#ifdef CONFIG_GPIOLIB
From: DENG Qingfang <dqfext@gmail.com> Date: 2021-07-31 02:54:35
On Sat, Jul 31, 2021 at 01:57:14AM +0300, Vladimir Oltean wrote:
quoted hunk
It is desirable to reduce the surface of DSA_TAG_PROTO_NONE as much as
we can, because we now have options for switches without hardware
support for DSA tagging, and the occurrence in the mt7530 driver is in
fact quite gratuitout and easy to remove. Since ds->ops->get_tag_protocol()
is only called for CPU ports, the checks for a CPU port in
mtk_get_tag_protocol() are redundant and can be removed.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/dsa/mt7530.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
@@ -1717,15 +1717,7 @@ static enum dsa_tag_protocolmtk_get_tag_protocol(structdsa_switch*ds,intport,enumdsa_tag_protocolmp){-structmt7530_priv*priv=ds->priv;--if(port!=MT7530_CPU_PORT){-dev_warn(priv->dev,-"port not matched with tagging CPU port\n");-returnDSA_TAG_PROTO_NONE;-}else{-returnDSA_TAG_PROTO_MTK;-}+returnDSA_TAG_PROTO_MTK;}#ifdef CONFIG_GPIOLIB
It is desirable to reduce the surface of DSA_TAG_PROTO_NONE as much as
we can, because we now have options for switches without hardware
support for DSA tagging, and the occurrence in the mt7530 driver is in
fact quite gratuitout and easy to remove. Since ds->ops->get_tag_protocol()
is only called for CPU ports, the checks for a CPU port in
mtk_get_tag_protocol() are redundant and can be removed.
The point of the check was in case the designated CPU port from device
tree/platform data would not match what the Mediatek driver supports,
similar to what b53 does in the same vein. I am fine with removing that
check for mt7530 as it does not look like there is an use case where the
CPU port is not actually MT7530_CPU_PORT.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
From: Vladimir Oltean <olteanv@gmail.com> Date: 2021-07-31 14:08:07
On Fri, Jul 30, 2021 at 08:08:43PM -0700, Florian Fainelli wrote:
On 7/30/2021 3:57 PM, Vladimir Oltean wrote:
quoted
It is desirable to reduce the surface of DSA_TAG_PROTO_NONE as much as
we can, because we now have options for switches without hardware
support for DSA tagging, and the occurrence in the mt7530 driver is in
fact quite gratuitout and easy to remove. Since ds->ops->get_tag_protocol()
is only called for CPU ports, the checks for a CPU port in
mtk_get_tag_protocol() are redundant and can be removed.
The point of the check was in case the designated CPU port from device
tree/platform data would not match what the Mediatek driver supports,
similar to what b53 does in the same vein. I am fine with removing that
check for mt7530 as it does not look like there is an use case where the CPU
port is not actually MT7530_CPU_PORT.
So if mt7530 only supports port 6 as a CPU port, how is Qingfang testing
multiple CPU ports on it?
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Sat, 31 Jul 2021 01:57:14 +0300 you wrote:
It is desirable to reduce the surface of DSA_TAG_PROTO_NONE as much as
we can, because we now have options for switches without hardware
support for DSA tagging, and the occurrence in the mt7530 driver is in
fact quite gratuitout and easy to remove. Since ds->ops->get_tag_protocol()
is only called for CPU ports, the checks for a CPU port in
mtk_get_tag_protocol() are redundant and can be removed.
[...]