netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: gfree.wind@foxmail.com
Cc: netfilter-devel@vger.kernel.org, Gao Feng <fgao@ikuai8.com>
Subject: Re: [PATCH nf-next 1/1] netfilter: expect: Add one common func nf_ct_remove_expect to simplify codes
Date: Thu, 6 Apr 2017 18:37:30 +0200	[thread overview]
Message-ID: <20170406163730.GA6747@salvia> (raw)
In-Reply-To: <1490581886-53648-1-git-send-email-gfree.wind@foxmail.com>

On Mon, Mar 27, 2017 at 10:31:26AM +0800, gfree.wind@foxmail.com wrote:
> From: Gao Feng <fgao@ikuai8.com>
> 
> When remove one expect, it needs three statements. And there are
> multiple duplicated codes in current codes. So add one common func
> nf_ct_remove_expect to simplify the codes.

Applied with short name:

netfilter: nf_ct_expect: Add nf_ct_remove_expect()

And...

> diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
> index 6dc44d9..97bc0d2 100644
> --- a/net/netfilter/nf_conntrack_helper.c
> +++ b/net/netfilter/nf_conntrack_helper.c
> @@ -448,10 +448,8 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
>  			if ((rcu_dereference_protected(
>  					help->helper,
>  					lockdep_is_held(&nf_conntrack_expect_lock)
> -					) == me || exp->helper == me) &&
> -			    del_timer(&exp->timeout)) {
> -				nf_ct_unlink_expect(exp);
> -				nf_ct_expect_put(exp);
> +					) == me || exp->helper == me)) {
> +				nf_ct_remove_expect(exp);
>  			}

We can now remove braces for single statement in if(), I've done this
manually here.

      reply	other threads:[~2017-04-06 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27  2:31 [PATCH nf-next 1/1] netfilter: expect: Add one common func nf_ct_remove_expect to simplify codes gfree.wind
2017-04-06 16:37 ` Pablo Neira Ayuso [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=20170406163730.GA6747@salvia \
    --to=pablo@netfilter.org \
    --cc=fgao@ikuai8.com \
    --cc=gfree.wind@foxmail.com \
    --cc=netfilter-devel@vger.kernel.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).