linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] watchdog: constify watchdog_ops and watchdog_info structures
Date: Mon, 7 Aug 2017 14:56:44 +0200	[thread overview]
Message-ID: <CACRpkdZ1WwqakQs1b4fjH_6T6jaox61RdabRSAWNC5_9o2osKA@mail.gmail.com> (raw)
In-Reply-To: <1501795291-21372-1-git-send-email-Julia.Lawall@lip6.fr>

On Thu, Aug 3, 2017 at 11:21 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> These watchdog_ops and watchdog_info structures are only stored
> in the ops and info fields of a watchdog_device structure,
> respectively, which are const.  Thus make the watchdog_ops and
> watchdog_info structures const as well.
>
> Done with the help of Coccinelle.  The rules for the watchdog_ops case are
> as follows:
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct watchdog_ops i at p = { ... };
>
> @ok@
> identifier r.i;
> struct watchdog_device e;
> position p;
> @@
> e.ops = &i at p;
>
> @bad@
> position p != {r.p,ok.p};
> identifier r.i;
> struct watchdog_ops e;
> @@
> e at 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

  reply	other threads:[~2017-08-07 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 21:21 [PATCH] watchdog: constify watchdog_ops and watchdog_info structures Julia Lawall
2017-08-07 12:56 ` Linus Walleij [this message]
2017-08-14 14:44 ` Guenter Roeck

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=CACRpkdZ1WwqakQs1b4fjH_6T6jaox61RdabRSAWNC5_9o2osKA@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).