diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2016-08-31 23:52:27 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-09-01 20:55:31 +0100 |
commit | f802d6c020658b5dce1732da0d5999a1a65afdd6 (patch) | |
tree | de881a189a3ea38294e52cad844531cbba0d41b5 /sound/soc/codecs/wm9713.c | |
parent | 2c452dd8af9da98b4b0ae1f12f8059160c7b11b5 (diff) | |
download | linux-f802d6c020658b5dce1732da0d5999a1a65afdd6.tar.gz linux-f802d6c020658b5dce1732da0d5999a1a65afdd6.tar.bz2 linux-f802d6c020658b5dce1732da0d5999a1a65afdd6.zip |
ASoC: constify snd_soc_codec_driver structures
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>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm9713.c')
-rw-r--r-- | sound/soc/codecs/wm9713.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 255a7c2d1d65..e4301ddb1b84 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c @@ -1235,7 +1235,7 @@ static int wm9713_soc_remove(struct snd_soc_codec *codec) return 0; } -static struct snd_soc_codec_driver soc_codec_dev_wm9713 = { +static const struct snd_soc_codec_driver soc_codec_dev_wm9713 = { .probe = wm9713_soc_probe, .remove = wm9713_soc_remove, .suspend = wm9713_soc_suspend, |