Skip to content

Commit

Permalink
net: core: devlink: simplify the return expression of devlink_nl_cmd_…
Browse files Browse the repository at this point in the history
…trap_set_doit()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Zheng Yongjun authored and David S. Miller committed Dec 9, 2020
1 parent 9faad25 commit 8daa76a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions net/core/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 *
Expand Down

0 comments on commit 8daa76a

Please sign in to comment.