ALSA: pci: constify snd_kcontrol_new structures
authorBhumika Goyal <bhumirks@gmail.com>
Sun, 19 Feb 2017 18:48:09 +0000 (00:18 +0530)
committerTakashi Iwai <tiwai@suse.de>
Tue, 21 Feb 2017 21:01:21 +0000 (22:01 +0100)
commitf3b827e0b1841f4cfc18436e09f4f269f3be908e
tree335d398cbfe7e913ecb2c9ceb33a702851b1caa0
parent34371d236eab28933eefc0d77bd1e3df62fc585b
ALSA: pci: constify snd_kcontrol_new structures

Declare snd_kcontrol_new structures as const as they are only passed as
an argument to the function snd_ctl_new1. This argument is of type
const, so snd_kcontrol_new structures having the same property can be
made const too.
Done using Coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct snd_kcontrol_new i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1;
@@
snd_ctl_new1(&i@p,e1)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct snd_kcontrol_new i;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
28 files changed:
sound/pci/au88x0/au88x0_a3d.c
sound/pci/au88x0/au88x0_eq.c
sound/pci/au88x0/au88x0_pcm.c
sound/pci/aw2/aw2-alsa.c
sound/pci/bt87x.c
sound/pci/ca0106/ca0106_mixer.c
sound/pci/cmipci.c
sound/pci/cs4281.c
sound/pci/echoaudio/echoaudio.c
sound/pci/emu10k1/emu10k1x.c
sound/pci/emu10k1/emumixer.c
sound/pci/emu10k1/emupcm.c
sound/pci/ens1370.c
sound/pci/hda/hda_codec.c
sound/pci/hda/patch_hdmi.c
sound/pci/ice1712/delta.c
sound/pci/ice1712/ews.c
sound/pci/ice1712/ice1712.c
sound/pci/ice1712/ice1724.c
sound/pci/lola/lola_mixer.c
sound/pci/lx6464es/lx6464es.c
sound/pci/mixart/mixart_mixer.c
sound/pci/pcxhr/pcxhr_mix22.c
sound/pci/pcxhr/pcxhr_mixer.c
sound/pci/trident/trident_main.c
sound/pci/via82xx.c
sound/pci/vx222/vx222_ops.c
sound/pci/ymfpci/ymfpci_main.c