From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: Patrick McHardy <kaber@trash.net>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
"David S. Miller" <davem@davemloft.net>,
netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org,
coreteam@netfilter.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] netfilter: remove unused variable
Date: Sat, 4 Jan 2014 00:11:46 +0100 [thread overview]
Message-ID: <20140103231146.GA23904@localhost> (raw)
In-Reply-To: <1388554039-28452-1-git-send-email-mina86@mina86.com>
On Wed, Jan 01, 2014 at 06:27:19AM +0100, Michal Nazarewicz wrote:
> The nfmsg variable is not used (except in sizeof operator which does
> not care about its value) between the first and second time it is
> assigned the value. Furthermore, nlmsg_data has no side effects, so
> the assignment can be safely removed.
Applied with minor glitch, see below.
Thanks.
> Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
> Cc: Patrick McHardy <kaber@trash.net>
> ---
> net/netfilter/nf_tables_api.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index f93b7d0..9c56adc 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -2521,7 +2521,6 @@ static int nf_tables_dump_set(struct sk_buff *skb, struct netlink_callback *cb)
> u32 portid, seq;
> int event, err;
>
> - nfmsg = nlmsg_data(cb->nlh);
> err = nlmsg_parse(cb->nlh, sizeof(*nfmsg), nla, NFTA_SET_ELEM_LIST_MAX,
mangled this patch to use sizeof(struct nfgenmsg) instead. That change
is not required from the semantic point of view, of course, but for
readability reasons I think it's better not to refer to a variable
that is not used in that context.
> nft_set_elem_list_policy);
> if (err < 0)
> --
> 1.8.4
>
next prev parent reply other threads:[~2014-01-03 23:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-01 5:27 [PATCH RESEND] netfilter: remove unused variable Michal Nazarewicz
2014-01-03 23:11 ` Pablo Neira Ayuso [this message]
2014-01-04 0:29 ` Michal Nazarewicz
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=20140103231146.GA23904@localhost \
--to=pablo@netfilter.org \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=mina86@mina86.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=netfilter@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.