aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-10-20 20:49:52 +0300
committerDavid S. Miller <davem@davemloft.net>2021-10-21 12:44:07 +0100
commit57d77986e7428752a05358386e3f80c2a08c13a7 (patch)
treec419607239de1a1da4c83de374c839d0c030d0b6 /net/dsa
parentnet: dsa: do not open-code dsa_switch_for_each_port (diff)
downloadlinux-dev-57d77986e7428752a05358386e3f80c2a08c13a7.tar.xz
linux-dev-57d77986e7428752a05358386e3f80c2a08c13a7.zip
net: dsa: remove gratuitous use of dsa_is_{user,dsa,cpu}_port
Find the occurrences of dsa_is_{user,dsa,cpu}_port where a struct dsa_port *dp was already available in the function scope, and replace them with the dsa_port_is_{user,dsa,cpu} equivalent function which uses that dp directly and does not perform another hidden dsa_to_port(). Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/port.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 3b14c9b6a922..bf671306b560 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -523,7 +523,7 @@ static bool dsa_port_can_apply_vlan_filtering(struct dsa_port *dp,
* enter an inconsistent state: deny changing the VLAN awareness state
* as long as we have 8021q uppers.
*/
- if (vlan_filtering && dsa_is_user_port(ds, dp->index)) {
+ if (vlan_filtering && dsa_port_is_user(dp)) {
struct net_device *upper_dev, *slave = dp->slave;
struct net_device *br = dp->bridge_dev;
struct list_head *iter;
@@ -1038,7 +1038,7 @@ static void dsa_port_phylink_mac_link_down(struct phylink_config *config,
struct phy_device *phydev = NULL;
struct dsa_switch *ds = dp->ds;
- if (dsa_is_user_port(ds, dp->index))
+ if (dsa_port_is_user(dp))
phydev = dp->slave->phydev;
if (!ds->ops->phylink_mac_link_down) {