From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: "David S. Miller" <davem@davemloft.net>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, coreteam@netfilter.org,
netfilter-devel@vger.kernel.org, Florian Westphal <fw@strlen.de>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Subject: Re: [PATCH nf-next] netfilter: constify nf_loginfo structures
Date: Wed, 2 Aug 2017 14:24:09 +0200 [thread overview]
Message-ID: <20170802122409.GB13459@salvia> (raw)
In-Reply-To: <1501584483-999-1-git-send-email-Julia.Lawall@lip6.fr>
On Tue, Aug 01, 2017 at 12:48:03PM +0200, Julia Lawall wrote:
> The nf_loginfo structures are only passed as the seventh argument to
> nf_log_trace, which is declared as const or stored in a local const
> variable. Thus the nf_loginfo structures themselves can be const.
>
> Done with the help of Coccinelle.
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct nf_loginfo i@p = { ... };
>
> @ok1@
> identifier r.i;
> expression list[6] es;
> position p;
> @@
> nf_log_trace(es,&i@p,...)
>
> @ok2@
> identifier r.i;
> const struct nf_loginfo *e;
> position p;
> @@
> e = &i@p
>
> @bad@
> position p != {r.p,ok1.p,ok2.p};
> identifier r.i;
> struct nf_loginfo e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct nf_loginfo i = { ... };
> // </smpl>
Applied, thanks Julia.
prev parent reply other threads:[~2017-08-02 12:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 10:48 [PATCH nf-next] netfilter: constify nf_loginfo structures Julia Lawall
2017-08-02 12:24 ` 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=20170802122409.GB13459@salvia \
--to=pablo@netfilter.org \
--cc=Julia.Lawall@lip6.fr \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=kadlec@blackhole.kfki.hu \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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).