Merge branch 'dsa-dont-unmask-port-bitmaps'

Vivien Didelot says:

====================
net: dsa: don't unmask port bitmaps

DSA has several bitmaps to store the type of ports: cpu_port_mask,
dsa_port_mask and enabled_port_mask. But the code is inconsistently
unmasking them.

The legacy code tries to unmask cpu_port_mask and dsa_port_mask but
skips enabled_port_mask.

The new bindings unmasks cpu_port_mask and enabled_port_mask but skips
dsa_port_mask.

In fact there is no need to unmask them because we are in the error
path, and they won't be used after. Instead of fixing the unmasking,
simply remove them.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2017-10-26 17:05:04 +09:00
commit 95fa7a0567
2 changed files with 0 additions and 8 deletions

View file

@ -260,8 +260,6 @@ static void dsa_cpu_port_unapply(struct dsa_port *port)
{
devlink_port_unregister(&port->devlink_port);
dsa_cpu_dsa_destroy(port);
port->ds->cpu_port_mask &= ~BIT(port->index);
}
static int dsa_user_port_apply(struct dsa_port *port)
@ -300,7 +298,6 @@ static void dsa_user_port_unapply(struct dsa_port *port)
if (port->slave) {
dsa_slave_destroy(port->slave);
port->slave = NULL;
port->ds->enabled_port_mask &= ~(1 << port->index);
}
}
@ -512,7 +509,6 @@ static int dsa_cpu_parse(struct dsa_port *port, u32 index,
tag_ops = dsa_resolve_tag_protocol(tag_protocol);
if (IS_ERR(tag_ops)) {
dev_warn(ds->dev, "No tagger for this switch\n");
ds->cpu_port_mask &= ~BIT(index);
return PTR_ERR(tag_ops);
}

View file

@ -272,10 +272,6 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)))
continue;
dsa_cpu_dsa_destroy(&ds->ports[port]);
/* Clearing a bit which is not set does no harm */
ds->cpu_port_mask |= ~(1 << port);
ds->dsa_port_mask |= ~(1 << port);
}
if (ds->slave_mii_bus && ds->ops->phy_read)