From: Pablo Neira Ayuso <pablo@netfilter.org>
To: fgao@ikuai8.com
Cc: netfilter-devel@vger.kernel.org, gfree.wind@gmail.com
Subject: Re: [PATCH nf-next v2 1/1] netfilter: nf_tables: Refine the codes to eliminate useless condition checks in nf_tables_api.c
Date: Wed, 18 Jan 2017 21:11:59 +0100 [thread overview]
Message-ID: <20170118201159.GA20220@salvia> (raw)
In-Reply-To: <1484575377-32755-1-git-send-email-fgao@ikuai8.com>
On Mon, Jan 16, 2017 at 10:02:57PM +0800, fgao@ikuai8.com wrote:
> From: Gao Feng <fgao@ikuai8.com>
>
> The return value of nf_tables_table_lookup is valid pointer or one
> pointer error. There are two cases totally.
> case1: IS_ERR(table) is true, it would return the error or reset the
> table as NULL, it is unnecessary to perform the latter check
> "table != NULL".
> case2: IS_ERR(obj) is false, the table is one valid pointer. It is also
> unnecessary to perform that check.
> The nf_tables_newset and nf_tables_newobj have same logic codes.
>
> In summary, we could move the block of condition check "table != NULL"
> in the else block to eliminate the original condition checks.
Applied, thanks feng.
prev parent reply other threads:[~2017-01-18 20:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 14:02 [PATCH nf-next v2 1/1] netfilter: nf_tables: Refine the codes to eliminate useless condition checks in nf_tables_api.c fgao
2017-01-18 20:11 ` 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=20170118201159.GA20220@salvia \
--to=pablo@netfilter.org \
--cc=fgao@ikuai8.com \
--cc=gfree.wind@gmail.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 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.