From: Florian Fainelli <f.fainelli@gmail.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] net: systemport: constify ethtool_ops structures
Date: Wed, 31 Aug 2016 10:08:54 -0700 [thread overview]
Message-ID: <6ed26afb-c052-aa00-4ab1-6777d5644809@gmail.com> (raw)
In-Reply-To: <1472628648-3603-7-git-send-email-Julia.Lawall@lip6.fr>
On 08/31/2016 12:30 AM, Julia Lawall wrote:
> Check for ethtool_ops structures that are only stored in the ethtool_ops
> field of a net_device structure or passed as the second argument to
> netdev_set_default_ethtool_ops. These contexts are declared const, so
> ethtool_ops structures that have these properties can be declared as const
> also.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct ethtool_ops i@p = { ... };
>
> @ok1@
> identifier r.i;
> struct net_device e;
> position p;
> @@
> e.ethtool_ops = &i@p;
>
> @ok2@
> identifier r.i;
> expression e;
> position p;
> @@
> netdev_set_default_ethtool_ops(e, &i@p)
>
> @bad@
> position p != {r.p,ok1.p,ok2.p};
> identifier r.i;
> @@
> i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct ethtool_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
next prev parent reply other threads:[~2016-08-31 17:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 7:30 [PATCH 0/6] constify ethtool_ops structures Julia Lawall
2016-08-31 7:30 ` [PATCH 1/6] staging: slicoss: " Julia Lawall
2016-08-31 7:30 ` [PATCH 2/6] net: ethernet: et131x: " Julia Lawall
2016-08-31 11:48 ` Mark Einon
2016-08-31 7:30 ` [PATCH 3/6] net: bcmgenet: " Julia Lawall
2016-08-31 17:08 ` Florian Fainelli
2016-08-31 7:30 ` [PATCH 4/6] net: hisilicon: " Julia Lawall
2016-08-31 7:30 ` [PATCH 5/6] dwc_eth_qos: " Julia Lawall
2016-08-31 7:30 ` [PATCH 6/6] net: systemport: " Julia Lawall
2016-08-31 17:08 ` Florian Fainelli [this message]
2016-08-31 15:39 ` [PATCH 0/6] " Stephen Hemminger
2016-08-31 19:40 ` Julia Lawall
2016-08-31 16:22 ` David Miller
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=6ed26afb-c052-aa00-4ab1-6777d5644809@gmail.com \
--to=f.fainelli@gmail.com \
--cc=Julia.Lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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).