netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf-next] netfilter: xt_nfacct: Use not operation instead of condition check
@ 2016-09-26 14:13 fgao
  2016-09-26 15:17 ` Florian Westphal
  0 siblings, 1 reply; 5+ messages in thread
From: fgao @ 2016-09-26 14:13 UTC (permalink / raw)
  To: pablo, netfilter-devel; +Cc: gfree.wind, Gao Feng

From: Gao Feng <fgao@ikuai8.com>

Use not operation instead of condition check to simplify the codes.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 net/netfilter/xt_nfacct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/xt_nfacct.c b/net/netfilter/xt_nfacct.c
index cf32759..7abb5b5 100644
--- a/net/netfilter/xt_nfacct.c
+++ b/net/netfilter/xt_nfacct.c
@@ -28,7 +28,7 @@ static bool nfacct_mt(const struct sk_buff *skb, struct xt_action_param *par)
 
 	overquota = nfnl_acct_overquota(par->net, skb, info->nfacct);
 
-	return overquota == NFACCT_UNDERQUOTA ? false : true;
+	return !(overquota == NFACCT_UNDERQUOTA);
 }
 
 static int
-- 
1.9.1



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

end of thread, other threads:[~2016-09-27  1:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 14:13 [PATCH nf-next] netfilter: xt_nfacct: Use not operation instead of condition check fgao
2016-09-26 15:17 ` Florian Westphal
2016-09-27  0:36   ` Gao Feng
2016-09-27  0:39     ` Florian Westphal
2016-09-27  1:04       ` Gao Feng

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