diff options
author | Takashi Iwai <tiwai@suse.de> | 2020-01-03 09:16:52 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2020-01-03 09:24:27 +0100 |
commit | 35ace5e8410e41df8719ee9fee49312655efa26a (patch) | |
tree | c02ed1899ec157db1d388c9b061a32c0dc4a7ccd /sound/pci/hda/hda_codec.c | |
parent | fdd1f6fd328ff2e3723fe2a5c94378ef6f217edc (diff) | |
download | lwn-35ace5e8410e41df8719ee9fee49312655efa26a.tar.gz lwn-35ace5e8410e41df8719ee9fee49312655efa26a.zip |
ALSA: hda: Constify snd_kcontrol_new items
Most of snd_kcontrol_new definitions are read-only and passed as-is.
Let's declare them as const for further optimization.
There should be no functional changes by this patch.
Link: https://lore.kernel.org/r/20200103081714.9560-37-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 8f166bbc438b..d039eeec080f 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -2387,7 +2387,7 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new dig_mixes[] = { +static const struct snd_kcontrol_new dig_mixes[] = { { .access = SNDRV_CTL_ELEM_ACCESS_READ, .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -2437,7 +2437,7 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec, { int err; struct snd_kcontrol *kctl; - struct snd_kcontrol_new *dig_mix; + const struct snd_kcontrol_new *dig_mix; int idx = 0; int val = 0; const int spdif_index = 16; @@ -2655,7 +2655,7 @@ static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new dig_in_ctls[] = { +static const struct snd_kcontrol_new dig_in_ctls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, SWITCH), @@ -2687,7 +2687,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) { int err; struct snd_kcontrol *kctl; - struct snd_kcontrol_new *dig_mix; + const struct snd_kcontrol_new *dig_mix; int idx; idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch", 0); |