[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160901094541.GD21682@localhost.localdomain>
Date: Thu, 1 Sep 2016 10:45:41 +0100
From: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
To: Julia Lawall <Julia.Lawall@...6.fr>
CC: Liam Girdwood <lgirdwood@...il.com>,
<kernel-janitors@...r.kernel.org>, Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
"Takashi Iwai" <tiwai@...e.com>,
<patches@...nsource.wolfsonmicro.com>,
<alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ASoC: constify snd_soc_codec_driver structures
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@...6.fr>
>
> ---
I haven't looked at every single case individually, but the ones
I have looked at look fine.
Acked-by: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
Thanks,
Charles
Powered by blists - more mailing lists