From: Florian Westphal <fw@strlen.de>
To: fgao@ikuai8.com
Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org,
gfree.wind@gmail.com
Subject: Re: [PATCH nf-next] netfilter: xt_nfacct: Use not operation instead of condition check
Date: Mon, 26 Sep 2016 17:17:56 +0200 [thread overview]
Message-ID: <20160926151756.GA17426@breakpoint.cc> (raw)
In-Reply-To: <1474899184-30187-1-git-send-email-fgao@ikuai8.com>
fgao@ikuai8.com <fgao@ikuai8.com> wrote:
> 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);
I don't find one better than the other. If you need to change
it for some reason consider
"return overquota != NFACCT_UNDERQUOTA"
instead of this strange negation.
But really, I think its fine as-is.
next prev parent reply other threads:[~2016-09-26 15:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2016-09-27 0:36 ` Gao Feng
2016-09-27 0:39 ` Florian Westphal
2016-09-27 1:04 ` Gao Feng
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=20160926151756.GA17426@breakpoint.cc \
--to=fw@strlen.de \
--cc=fgao@ikuai8.com \
--cc=gfree.wind@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.