Commit cf1c39d3 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: dsa: avoid one dsa_to_port() in dsa_slave_change_mtu

We could retrieve the cpu_dp pointer directly from the "dp" we already
have, no need to resort to dsa_to_port(ds, port).

This change also removes the need for an "int port", so that is also
deleted.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b2033a05
......@@ -1807,10 +1807,9 @@ int dsa_slave_change_mtu(struct net_device *dev, int new_mtu)
struct net_device *master = dsa_slave_to_master(dev);
struct dsa_port *dp = dsa_slave_to_port(dev);
struct dsa_slave_priv *p = netdev_priv(dev);
struct dsa_port *cpu_dp = dp->cpu_dp;
struct dsa_switch *ds = p->dp->ds;
struct dsa_port *other_dp;
struct dsa_port *cpu_dp;
int port = p->dp->index;
int largest_mtu = 0;
int new_master_mtu;
int old_master_mtu;
......@@ -1843,8 +1842,6 @@ int dsa_slave_change_mtu(struct net_device *dev, int new_mtu)
largest_mtu = slave_mtu;
}
cpu_dp = dsa_to_port(ds, port)->cpu_dp;
mtu_limit = min_t(int, master->max_mtu, dev->max_mtu);
old_master_mtu = master->mtu;
new_master_mtu = largest_mtu + dsa_tag_protocol_overhead(cpu_dp->tag_ops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment