From: kbuild test robot <fengguang.wu@intel.com>
To: Benedict Wong <benedictwong@google.com>
Cc: kbuild-all@01.org, netdev@vger.kernel.org,
Steffen Klassert <steffen.klassert@secunet.com>
Subject: [PATCH] xfrm: fix ptr_ret.cocci warnings
Date: Thu, 26 Jul 2018 15:09:52 +0800 [thread overview]
Message-ID: <20180726070952.GA135949@lkp-ib03> (raw)
In-Reply-To: <201807261538.y1P9yjWE%fengguang.wu@intel.com>
From: kbuild test robot <fengguang.wu@intel.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@google.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.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)
next prev parent reply other threads:[~2018-07-26 8:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 7:09 [ipsec-next:testing 13/13] net/xfrm/xfrm_interface.c:692:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2018-07-26 7:09 ` kbuild test robot [this message]
2018-07-27 5:39 ` [PATCH] xfrm: fix ptr_ret.cocci warnings Steffen Klassert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180726070952.GA135949@lkp-ib03 \
--to=fengguang.wu@intel.com \
--cc=benedictwong@google.com \
--cc=kbuild-all@01.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).