aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/via82xx.c
diff options
context:
space:
mode:
authorBhumika Goyal <bhumirks@gmail.com>2017-02-20 00:18:09 +0530
committerTakashi Iwai <tiwai@suse.de>2017-02-21 22:01:21 +0100
commitf3b827e0b1841f4cfc18436e09f4f269f3be908e (patch)
tree335d398cbfe7e913ecb2c9ceb33a702851b1caa0 /sound/pci/via82xx.c
parentALSA: usb-audio: localize function without external linkage (diff)
downloadlinux-dev-f3b827e0b1841f4cfc18436e09f4f269f3be908e.tar.xz
linux-dev-f3b827e0b1841f4cfc18436e09f4f269f3be908e.zip
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>
Diffstat (limited to 'sound/pci/via82xx.c')
-rw-r--r--sound/pci/via82xx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 2d8c14e3f8d2..d078e86414c2 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -1683,7 +1683,7 @@ static int snd_via8233_dxs3_spdif_put(struct snd_kcontrol *kcontrol,
return 0;
}
-static struct snd_kcontrol_new snd_via8233_dxs3_spdif_control = {
+static const struct snd_kcontrol_new snd_via8233_dxs3_spdif_control = {
.name = SNDRV_CTL_NAME_IEC958("Output ",NONE,SWITCH),
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.info = snd_via8233_dxs3_spdif_info,
@@ -1772,7 +1772,7 @@ static int snd_via8233_pcmdxs_volume_put(struct snd_kcontrol *kcontrol,
static const DECLARE_TLV_DB_SCALE(db_scale_dxs, -4650, 150, 1);
-static struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control = {
+static const struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control = {
.name = "PCM Playback Volume",
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
@@ -1783,7 +1783,7 @@ static struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control = {
.tlv = { .p = db_scale_dxs }
};
-static struct snd_kcontrol_new snd_via8233_dxs_volume_control = {
+static const struct snd_kcontrol_new snd_via8233_dxs_volume_control = {
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
.device = 0,
/* .subdevice set later */