#ifndef BPF_EXT
#define BPF_EXT
#ifndef SKF_AD_OFF
# define SKF_AD_OFF (-0x1000)
#endif
#ifndef SKF_AD_PROTOCOL
# define SKF_AD_PROTOCOL 0
#endif
#ifndef SKF_AD_PKTTYPE
# define SKF_AD_PKTTYPE 4
#endif
#ifndef SKF_AD_IFINDEX
# define SKF_AD_IFINDEX 8
#endif
#ifndef SKF_AD_NLATTR
# define SKF_AD_NLATTR 12
#endif
#ifndef SKF_AD_NLATTR_NEST
# define SKF_AD_NLATTR_NEST 16
#endif
#ifndef SKF_AD_MARK
# define SKF_AD_MARK 20
#endif
#ifndef SKF_AD_QUEUE
# define SKF_AD_QUEUE 24
#endif
#ifndef SKF_AD_HATYPE
# define SKF_AD_HATYPE 28
#endif
#ifndef SKF_AD_RXHASH
# define SKF_AD_RXHASH 32
#endif
#ifndef SKF_AD_CPU
# define SKF_AD_CPU 36
#endif
#ifndef SKF_AD_VLAN_TAG
# define SKF_AD_VLAN_TAG 44
#endif
#ifndef SKF_AD_VLAN_TAG_PRESENT
# define SKF_AD_VLAN_TAG_PRESENT 48
#endif
#ifndef SKF_AD_PAY_OFFSET
# define SKF_AD_PAY_OFFSET 52
#endif
#endif /* BPF_EXT */
a>
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>