From: kbuild test robot Date: Thu, 26 Jul 2018 07:09:52 +0000 (+0800) Subject: UPSTREAM: xfrm: fix ptr_ret.cocci warnings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=35b4fe32bbf2ed4a2801ffbeb9f1165cbab143dc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git UPSTREAM: xfrm: fix ptr_ret.cocci warnings net/xfrm/xfrm_interface.c:692:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Fixes: 44e2b838c24d ("xfrm: Return detailed errors from xfrmi_newlink") CC: Benedict Wong Signed-off-by: kbuild test robot Signed-off-by: Steffen Klassert (cherry picked from commit c6f5e017df9dfa9f6cbe70da008e7d716d726f1b) Signed-off-by: Benedict Wong Bug: 113046120 Test: All kernel net-tests run, passing (20x repeated) Change-Id: I4ec93c0427fded57ff5126dc7b3d97d9b5fd615b --- diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c index 481d7307ab51..31acc6f33d98 100644 --- a/net/xfrm/xfrm_interface.c +++ b/net/xfrm/xfrm_interface.c @@ -689,10 +689,7 @@ static int xfrmi_newlink(struct net *src_net, struct net_device *dev, nla_strlcpy(p->name, tb[IFLA_IFNAME], IFNAMSIZ); xi = xfrmi_locate(net, p, 1); - if (IS_ERR(xi)) - return PTR_ERR(xi); - - return 0; + return PTR_ERR_OR_ZERO(xi); } static void xfrmi_dellink(struct net_device *dev, struct list_head *head)