2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 06:04:14 +08:00
linux-next/sound/soc/atmel
Julia Lawall 28549313da ASoC: atmel_wm8904: constify snd_soc_ops structures
Check for snd_soc_ops structures that are only stored in the ops field of a
snd_soc_dai_link structure.  This field is declared const, so snd_soc_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 snd_soc_ops i@p = { ... };

@ok1@
identifier r.i;
struct snd_soc_dai_link e;
position p;
@@
e.ops = &i@p;

@ok2@
identifier r.i, e;
position p;
@@
struct snd_soc_dai_link e[] = { ..., { .ops = &i@p, }, ..., };

@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_soc_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct snd_soc_ops i = { ... };
// </smpl>

The effect on the layout of the .o file is shown by the following output of
the size command, first before then after the transformation:

   text    data     bss     dec     hex filename
   2611    1536       0    4147    1033 sound/soc/atmel/atmel_wm8904.o
   2675    1480       0    4155    103b sound/soc/atmel/atmel_wm8904.o

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-24 18:32:54 +01:00
..
atmel_ssc_dai.c ASoC: atmel_ssc_dai: Don't unconditionally reset SSC on stream startup 2016-08-16 12:29:10 +01:00
atmel_ssc_dai.h ASoC: atmel_ssc_dai: Allow more rates 2015-02-10 15:12:41 +08:00
atmel_wm8904.c ASoC: atmel_wm8904: constify snd_soc_ops structures 2016-10-24 18:32:54 +01:00
atmel-classd.c ASoC: codec duplicated callback function goes to component on atmel-classd 2016-08-08 11:57:57 +01:00
atmel-classd.h ASoC: atmel-classd: add the Audio Class D Amplifier 2015-10-23 01:48:33 +09:00
atmel-pcm-dma.c ASoC: dmaengine_pcm: Make FLAG_NO_RESIDUE internal 2015-04-27 19:26:07 +01:00
atmel-pcm-pdc.c ASoC: constify snd_pcm_ops structures 2016-09-12 20:04:09 +01:00
atmel-pcm.h ASoC: atmel-pcm-pdc: merge atmel-pcm back in 2015-04-01 21:24:27 +01:00
atmel-pdmic.c Merge remote-tracking branches 'asoc/topic/ac97', 'asoc/topic/ak4104', 'asoc/topic/arizona', 'asoc/topic/atmel' and 'asoc/topic/codec-component' into asoc-next 2016-09-29 12:44:07 -07:00
atmel-pdmic.h ASoC: atmel-pdmic: add the Pulse Density Modulation Interface Controller 2015-12-18 07:02:37 +00:00
Kconfig ASoC: atmel: fix build failure 2016-06-06 17:00:47 +01:00
Makefile ASoC: atmel-pdmic: add the Pulse Density Modulation Interface Controller 2015-12-18 07:02:37 +00:00
sam9g20_wm8731.c ASoC: at91sam9g20ek: Automatically disconnect non-connected pins 2015-04-27 15:39:23 +01:00
sam9x5_wm8731.c ASoC: atmel: drop owner assignment from platform_drivers 2014-10-20 16:22:03 +02:00