From: Guenter Roeck <linux@roeck-us.net>
To: Julia Lawall <Julia.Lawall@lip6.fr>, Wim Van Sebroeck <wim@iguana.be>
Cc: kernel-janitors@vger.kernel.org, linux-watchdog@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] watchdog: constify watchdog_ops structures
Date: Thu, 8 Sep 2016 21:29:13 -0700 [thread overview]
Message-ID: <d0b260e7-1f71-35e3-3b8c-2c71495431bf@roeck-us.net> (raw)
In-Reply-To: <1472751326-22897-3-git-send-email-Julia.Lawall@lip6.fr>
On 09/01/2016 10:35 AM, Julia Lawall wrote:
> Check for watchdog_ops structures that are only stored in the ops field of
> a watchdog_device structure. This field is declared const, so watchdog_ops
> structures that have this property 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 watchdog_ops i@p = { ... };
>
> @ok@
> identifier r.i;
> struct watchdog_device e;
> position p;
> @@
> e.ops = &i@p;
>
> @bad@
> position p != {r.p,ok.p};
> identifier r.i;
> struct watchdog_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct watchdog_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
prev parent reply other threads:[~2016-09-09 4:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-01 17:35 [PATCH 0/2] constify watchdog_ops structures Julia Lawall
2016-09-01 17:35 ` [PATCH 1/2] watchdog: tegra: " Julia Lawall
2016-09-06 9:13 ` Thierry Reding
2016-09-09 4:28 ` Guenter Roeck
2016-09-01 17:35 ` [PATCH 2/2] watchdog: " Julia Lawall
2016-09-09 4:29 ` Guenter Roeck [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=d0b260e7-1f71-35e3-3b8c-2c71495431bf@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Julia.Lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@iguana.be \
/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).