From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Gargi Sharma <gs051095@gmail.com>
Cc: netfilter-devel@vger.kernel.org, outreachy-kernel@googlegroups.com
Subject: Re: [PATCH] iptables: Constify option struct
Date: Mon, 27 Mar 2017 21:12:39 +0200 [thread overview]
Message-ID: <20170327191239.GA18080@salvia> (raw)
In-Reply-To: <1490641815-12741-1-git-send-email-gs051095@gmail.com>
On Tue, Mar 28, 2017 at 12:40:15AM +0530, Gargi Sharma wrote:
> The struct of the type option is only used to initialise a field
> inside the xtables_match struct and is not modified anywhere.
> Done using Coccinelle:
>
> @r1 disable optional_qualifier@
> identifier s,i;
> position p;
> @@
>
> static struct option i@p[] ={...};
>
> @ok1@
> identifier r1.i;
> expression e;
> position p;
> @@
> e = i@p
>
> @bad@
> position p != {r1.p,ok1.p};
> identifier r1.i;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r1.i;
> @@
> static
> +const
> struct option i[] = { ... };
Applied, thanks.
You can probably have a look at ebtables.git, probably there are more
things to constify there.
next prev parent reply other threads:[~2017-03-27 19:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-27 19:10 [PATCH] iptables: Constify option struct Gargi Sharma
2017-03-27 19:12 ` Pablo Neira Ayuso [this message]
2017-03-27 19:15 ` [Outreachy kernel] " Gargi Sharma
2017-03-27 19:57 ` Gargi Sharma
2017-03-27 21:37 ` Julia Lawall
-- strict thread matches above, loose matches on Subject: below --
2017-09-27 11:44 Harsha Sharma
2017-10-04 14:08 ` Pablo Neira Ayuso
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=20170327191239.GA18080@salvia \
--to=pablo@netfilter.org \
--cc=gs051095@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=outreachy-kernel@googlegroups.com \
/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).