From: Li Zetao Date: Thu, 22 Aug 2024 04:32:43 +0000 (+0800) Subject: net: vxlan: delete redundant judgment statements X-Git-Tag: v6.12-rc1~232^2~195^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ef1ca2d14f2a78a83dfd40e34f53e8d5c1c0b4b;p=thirdparty%2Flinux.git net: vxlan: delete redundant judgment statements The initial value of err is -ENOBUFS, and err is guaranteed to be less than 0 before all goto errout. Therefore, on the error path of errout, there is no need to repeatedly judge that err is less than 0, and delete redundant judgments to make the code more concise. Signed-off-by: Li Zetao Reviewed-by: Petr Machata Signed-off-by: David S. Miller --- diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 8983e75e9881d..34391c18bba7e 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -277,8 +277,7 @@ static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb, rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC); return; errout: - if (err < 0) - rtnl_set_sk_err(net, RTNLGRP_NEIGH, err); + rtnl_set_sk_err(net, RTNLGRP_NEIGH, err); } static void vxlan_fdb_switchdev_notifier_info(const struct vxlan_dev *vxlan,