[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180726070952.GA135949@lkp-ib03>
Date: Thu, 26 Jul 2018 15:09:52 +0800
From: kbuild test robot <fengguang.wu@...el.com>
To: Benedict Wong <benedictwong@...gle.com>
Cc: kbuild-all@...org, netdev@...r.kernel.org,
Steffen Klassert <steffen.klassert@...unet.com>
Subject: [PATCH] xfrm: fix ptr_ret.cocci warnings
From: kbuild test robot <fengguang.wu@...el.com>
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 <benedictwong@...gle.com>
Signed-off-by: kbuild test robot <fengguang.wu@...el.com>
---
xfrm_interface.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -689,10 +689,7 @@ static int xfrmi_newlink(struct net *src
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)
Powered by blists - more mailing lists