]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dpaa2-switch: remove duplicated check for the maximum number of VLANs
authorIoana Ciornei <ioana.ciornei@nxp.com>
Thu, 28 May 2026 17:34:50 +0000 (20:34 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 3 Jun 2026 02:13:18 +0000 (19:13 -0700)
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>
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

index 53a32b21b95934bdb65e7394d8bceaabd615e80b..4022635171b53856323a8341ae488d9566258ea2 100644 (file)
@@ -1811,16 +1811,6 @@ int dpaa2_switch_port_vlans_add(struct net_device *netdev,
                return -EEXIST;
        }
 
-       /* Check if there is space for a new VLAN */
-       err = dpsw_get_attributes(ethsw->mc_io, 0, ethsw->dpsw_handle,
-                                 &ethsw->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;
-
        /* Check if there is space for a new VLAN */
        err = dpsw_get_attributes(ethsw->mc_io, 0, ethsw->dpsw_handle,
                                  &ethsw->sw_attr);