alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	patches@opensource.wolfsonmicro.com,
	kernel-janitors@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] ASoC: constify snd_soc_codec_driver structures
Date: Thu, 1 Sep 2016 10:45:41 +0100	[thread overview]
Message-ID: <20160901094541.GD21682@localhost.localdomain> (raw)
In-Reply-To: <1472680347-19575-1-git-send-email-Julia.Lawall@lip6.fr>

On Wed, Aug 31, 2016 at 11:52:27PM +0200, Julia Lawall wrote:
> Check for snd_soc_codec_driver structures that are only passed to
> snd_soc_register_codec or memcpy (2nd arg), for which the corresponding
> parameters are declared const.  Declare as const snd_soc_codec_driver
> structures that have these properties.
> 
> 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 snd_soc_codec_driver i@p = { ... };
> 
> @ok@
> identifier r.i;
> expression e1,e2,e3;
> position p;
> @@
> (
> snd_soc_register_codec(e1,&i@p,e2,e3)
> |
> memcpy(e1,&i@p,e2)
> )
> 
> @bad@
> position p != {r.p,ok.p};
> identifier r.i;
> @@
> i@p
> 
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
>  struct snd_soc_codec_driver i = { ... };
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

I haven't looked at every single case individually, but the ones
I have looked at look fine.

Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Thanks,
Charles

      reply	other threads:[~2016-09-01  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 21:52 [PATCH] ASoC: constify snd_soc_codec_driver structures Julia Lawall
2016-09-01  9:45 ` Charles Keepax [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=20160901094541.GD21682@localhost.localdomain \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=tiwai@suse.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).