diff options
| author | Ioana Ciornei <ioana.ciornei@nxp.com> | 2026-05-28 20:34:50 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-06-03 05:13:18 +0300 |
| commit | 9e9f5e2998052c49e506b8307e5bca7584600a3a (patch) | |
| tree | 966a9b696f4e256a772f02d2bc68cab53e026e20 | |
| parent | 74c1c9f5c0c30bbd0c2cf87b6e3507e7ea46c13d (diff) | |
| download | linux-9e9f5e2998052c49e506b8307e5bca7584600a3a.tar.xz | |
dpaa2-switch: remove duplicated check for the maximum number of VLANs
The check for the maximum number of VLANs is exactly duplicated twice in
the dpaa2_switch_port_vlans_add() function. Remove one of the instances
so that we do not have dead code.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://patch.msgid.link/20260528173452.1953102-4-ioana.ciornei@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| -rw-r--r-- | drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 53a32b21b959..4022635171b5 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1821,16 +1821,6 @@ int dpaa2_switch_port_vlans_add(struct net_device *netdev, if (attr->max_vlans - attr->num_vlans < 1) return -ENOSPC; - /* Check if there is space for a new VLAN */ - err = dpsw_get_attributes(ethsw->mc_io, 0, ethsw->dpsw_handle, - ðsw->sw_attr); - if (err) { - netdev_err(netdev, "dpsw_get_attributes err %d\n", err); - return err; - } - if (attr->max_vlans - attr->num_vlans < 1) - return -ENOSPC; - if (!port_priv->ethsw_data->vlans[vlan->vid]) { /* this is a new VLAN */ err = dpaa2_switch_add_vlan(port_priv, vlan->vid); |
