diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2020-12-08 20:10:46 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-12-08 16:22:54 -0800 |
commit | 8daa76a52dfd9dac4be87a37269c225c15977bdd (patch) | |
tree | 4a775e96ee765b55f94d933608820785ab2ba8e0 /net/core/devlink.c | |
parent | 9faad250ce66ed4159fa095a269690d7cfdb3ce3 (diff) |
net: core: devlink: simplify the return expression of devlink_nl_cmd_trap_set_doit()
Simplify the return expression.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/devlink.c')
-rw-r--r-- | net/core/devlink.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c index 88c0ac8ed444..ee828e4b1007 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -6993,7 +6993,6 @@ static int devlink_nl_cmd_trap_set_doit(struct sk_buff *skb, struct netlink_ext_ack *extack = info->extack; struct devlink *devlink = info->user_ptr[0]; struct devlink_trap_item *trap_item; - int err; if (list_empty(&devlink->trap_list)) return -EOPNOTSUPP; @@ -7004,11 +7003,7 @@ static int devlink_nl_cmd_trap_set_doit(struct sk_buff *skb, return -ENOENT; } - err = devlink_trap_action_set(devlink, trap_item, info); - if (err) - return err; - - return 0; + return devlink_trap_action_set(devlink, trap_item, info); } static struct devlink_trap_group_item * |