summaryrefslogtreecommitdiff
path: root/drivers/net/vrf.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2015-08-19 06:27:10 +0300
committerDavid S. Miller <davem@davemloft.net>2015-08-20 13:01:57 -0700
commit2640b39c28174dba1c9e089be575d87e5204282f (patch)
tree31469786ba4ba2c8999290fe13d6a000e8a7a2ac /drivers/net/vrf.c
parent15df5e711245743a7a8018dd6535e39dcfcb38fc (diff)
vrf: ndo_add|del_slave drop unnecessary checks
When ndo_add|del_slave ops are used, they're taken from the respective master device's netdev ops, so if the master device is a VRF only then the VRF ops will get called thus no need to check the type of the master. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vrf.c')
-rw-r--r--drivers/net/vrf.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 4825c65c62fd..dbeffe789185 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -393,8 +393,7 @@ out_fail:
static int vrf_add_slave(struct net_device *dev, struct net_device *port_dev)
{
- if (!netif_is_vrf(dev) || netif_is_vrf(port_dev) ||
- vrf_is_slave(port_dev))
+ if (netif_is_vrf(port_dev) || vrf_is_slave(port_dev))
return -EINVAL;
return do_vrf_add_slave(dev, port_dev);
@@ -431,9 +430,6 @@ static int do_vrf_del_slave(struct net_device *dev, struct net_device *port_dev)
static int vrf_del_slave(struct net_device *dev, struct net_device *port_dev)
{
- if (!netif_is_vrf(dev))
- return -EINVAL;
-
return do_vrf_del_slave(dev, port_dev);
}