netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: connlimit: fix boolreturn.cocci warnings
  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 ptr_ret.cocci warnings kbuild test robot
@ 2017-12-19 17:46 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2017-12-19 17:46 UTC (permalink / raw)
  To: Florian Westphal; +Cc: kbuild-all, netfilter-devel, coreteam, Pablo Neira Ayuso

From: Fengguang Wu <fengguang.wu@intel.com>

net/netfilter/nf_conncount.c:74:9-10: WARNING: return of 0/1 in function 'already_closed' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.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>
---

 nf_conncount.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/netfilter/nf_conncount.c
+++ b/net/netfilter/nf_conncount.c
@@ -71,7 +71,7 @@ static inline bool already_closed(const
 		return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT ||
 		       conn->proto.tcp.state == TCP_CONNTRACK_CLOSE;
 	else
-		return 0;
+		return false;
 }
 
 static int key_diff(const u32 *a, const u32 *b, unsigned int klen)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] netfilter: connlimit: fix ptr_ret.cocci warnings
  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 ` kbuild test robot
  2017-12-19 17:46 ` [PATCH] netfilter: connlimit: fix boolreturn.cocci warnings kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2017-12-19 17:46 UTC (permalink / raw)
  To: Florian Westphal; +Cc: kbuild-all, netfilter-devel, coreteam, Pablo Neira Ayuso

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [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
@ 2017-12-19 17:46 kbuild test robot
  2017-12-19 17:46 ` [PATCH] netfilter: connlimit: fix ptr_ret.cocci warnings kbuild test robot
  2017-12-19 17:46 ` [PATCH] netfilter: connlimit: fix boolreturn.cocci warnings kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: kbuild test robot @ 2017-12-19 17:46 UTC (permalink / raw)
  To: Florian Westphal; +Cc: kbuild-all, netfilter-devel, coreteam, Pablo Neira Ayuso

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git for-net-next3
head:   dfbb1c16489ca1b93e3f8aebc74d9229f1d87cc6
commit: 61b781a5a0bb7fcbbb3be316271fccf59915e3b0 [32/40] netfilter: connlimit: split xt_connlimit into front and backend


coccinelle warnings: (new ones prefixed by >>)

>> net/netfilter/nf_conncount.c:74:9-10: WARNING: return of 0/1 in function 'already_closed' with return type bool
--
>> net/netfilter/xt_connlimit.c:96:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-19 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ptr_ret.cocci warnings kbuild test robot
2017-12-19 17:46 ` [PATCH] netfilter: connlimit: fix boolreturn.cocci warnings kbuild test robot

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).