Commit f3d736c4 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: remove dsa_port_is_bridged

The helper is only used once and makes the code more complicated that it
should. Remove it and reorganize the variables so that it fits on 80
columns.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 90592b9a
...@@ -69,18 +69,13 @@ static int dsa_slave_get_iflink(const struct net_device *dev) ...@@ -69,18 +69,13 @@ static int dsa_slave_get_iflink(const struct net_device *dev)
return p->dp->ds->dst->master_netdev->ifindex; return p->dp->ds->dst->master_netdev->ifindex;
} }
static inline bool dsa_port_is_bridged(struct dsa_port *dp)
{
return !!dp->bridge_dev;
}
static int dsa_slave_open(struct net_device *dev) static int dsa_slave_open(struct net_device *dev)
{ {
struct dsa_slave_priv *p = netdev_priv(dev); struct dsa_slave_priv *p = netdev_priv(dev);
struct net_device *master = p->dp->ds->dst->master_netdev; struct dsa_port *dp = p->dp;
struct dsa_switch *ds = p->dp->ds; struct dsa_switch *ds = dp->ds;
u8 stp_state = dsa_port_is_bridged(p->dp) ? struct net_device *master = ds->dst->master_netdev;
BR_STATE_BLOCKING : BR_STATE_FORWARDING; u8 stp_state = dp->bridge_dev ? BR_STATE_BLOCKING : BR_STATE_FORWARDING;
int err; int err;
if (!(master->flags & IFF_UP)) if (!(master->flags & IFF_UP))
......
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