diff options
| author | Vladimir Oltean <[email protected]> | 2021-01-09 00:01:49 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2021-01-12 00:00:56 +0000 |
| commit | cf6def51badebbacaedd3999a4d94761197e18b4 (patch) | |
| tree | 5e78fbfb58bb1d7fc51bf605de47cca7d006f9cc /net/switchdev/switchdev.c | |
| parent | net: switchdev: remove the transaction structure from port object notifiers (diff) | |
| download | kernel-cf6def51badebbacaedd3999a4d94761197e18b4.tar.gz kernel-cf6def51badebbacaedd3999a4d94761197e18b4.zip | |
net: switchdev: delete switchdev_port_obj_add_now
After the removal of the transactional model inside
switchdev_port_obj_add_now, it has no added value and we can just call
switchdev_port_obj_notify directly, bypassing this function. Let's
delete it.
Signed-off-by: Vladimir Oltean <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Reviewed-by: Ido Schimmel <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
| -rw-r--r-- | net/switchdev/switchdev.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index a575bb33ee6c..3509d362056d 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -242,23 +242,15 @@ static int switchdev_port_obj_notify(enum switchdev_notifier_type nt, return 0; } -static int switchdev_port_obj_add_now(struct net_device *dev, - const struct switchdev_obj *obj, - struct netlink_ext_ack *extack) -{ - ASSERT_RTNL(); - - return switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD, - dev, obj, extack); -} - static void switchdev_port_obj_add_deferred(struct net_device *dev, const void *data) { const struct switchdev_obj *obj = data; int err; - err = switchdev_port_obj_add_now(dev, obj, NULL); + ASSERT_RTNL(); + err = switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD, + dev, obj, NULL); if (err && err != -EOPNOTSUPP) netdev_err(dev, "failed (err=%d) to add object (id=%d)\n", err, obj->id); @@ -290,7 +282,8 @@ int switchdev_port_obj_add(struct net_device *dev, if (obj->flags & SWITCHDEV_F_DEFER) return switchdev_port_obj_add_defer(dev, obj); ASSERT_RTNL(); - return switchdev_port_obj_add_now(dev, obj, extack); + return switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD, + dev, obj, extack); } EXPORT_SYMBOL_GPL(switchdev_port_obj_add); |
