From: kbuild test robot <fengguang.wu@intel.com>
To: Florian Westphal <fw@strlen.de>
Cc: kbuild-all@01.org, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org, Pablo Neira Ayuso <pablo@netfilter.org>
Subject: [PATCH] netfilter: connlimit: fix ptr_ret.cocci warnings
Date: Wed, 20 Dec 2017 01:46:41 +0800 [thread overview]
Message-ID: <20171219174641.GA31011@lkp-wsm-ep1> (raw)
In-Reply-To: <201712200137.1Bakdeow%fengguang.wu@intel.com>
From: Fengguang Wu <fengguang.wu@intel.com>
net/netfilter/xt_connlimit.c:96: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: 61b781a5a0bb ("netfilter: connlimit: split xt_connlimit into front and backend")
CC: Florian Westphal <fw@strlen.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
xt_connlimit.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -93,10 +93,7 @@ static int connlimit_mt_check(const stru
/* init private data */
info->data = nf_conncount_init(par->net, par->family, keylen);
- if (IS_ERR(info->data))
- return PTR_ERR(info->data);
-
- return 0;
+ return PTR_ERR_OR_ZERO(info->data);
}
static void connlimit_mt_destroy(const struct xt_mtdtor_param *par)
prev parent reply other threads:[~2017-12-19 17:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-19 17:46 [nf-next:for-net-next3 32/40] net/netfilter/nf_conncount.c:74:9-10: WARNING: return of 0/1 in function 'already_closed' with return type bool kbuild test robot
2017-12-19 17:46 ` [PATCH] netfilter: connlimit: fix boolreturn.cocci warnings kbuild test robot
2017-12-19 17:46 ` kbuild test robot [this message]
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=20171219174641.GA31011@lkp-wsm-ep1 \
--to=fengguang.wu@intel.com \
--cc=coreteam@netfilter.org \
--cc=fw@strlen.de \
--cc=kbuild-all@01.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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).