Commit 35ace5e8 authored by Takashi Iwai's avatar Takashi Iwai

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.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent fdd1f6fd
...@@ -2387,7 +2387,7 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol, ...@@ -2387,7 +2387,7 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol,
return change; return change;
} }
static struct snd_kcontrol_new dig_mixes[] = { static const struct snd_kcontrol_new dig_mixes[] = {
{ {
.access = SNDRV_CTL_ELEM_ACCESS_READ, .access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -2437,7 +2437,7 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec, ...@@ -2437,7 +2437,7 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec,
{ {
int err; int err;
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
struct snd_kcontrol_new *dig_mix; const struct snd_kcontrol_new *dig_mix;
int idx = 0; int idx = 0;
int val = 0; int val = 0;
const int spdif_index = 16; const int spdif_index = 16;
...@@ -2655,7 +2655,7 @@ static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol, ...@@ -2655,7 +2655,7 @@ static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol,
return 0; 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("", CAPTURE, SWITCH), .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) ...@@ -2687,7 +2687,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid)
{ {
int err; int err;
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
struct snd_kcontrol_new *dig_mix; const struct snd_kcontrol_new *dig_mix;
int idx; int idx;
idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch", 0); idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch", 0);
......
...@@ -825,11 +825,11 @@ static int stac_auto_create_beep_ctls(struct hda_codec *codec, ...@@ -825,11 +825,11 @@ static int stac_auto_create_beep_ctls(struct hda_codec *codec,
struct sigmatel_spec *spec = codec->spec; struct sigmatel_spec *spec = codec->spec;
u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT); u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
struct snd_kcontrol_new *knew; struct snd_kcontrol_new *knew;
static struct snd_kcontrol_new abeep_mute_ctl = static const struct snd_kcontrol_new abeep_mute_ctl =
HDA_CODEC_MUTE(NULL, 0, 0, 0); HDA_CODEC_MUTE(NULL, 0, 0, 0);
static struct snd_kcontrol_new dbeep_mute_ctl = static const struct snd_kcontrol_new dbeep_mute_ctl =
HDA_CODEC_MUTE_BEEP(NULL, 0, 0, 0); HDA_CODEC_MUTE_BEEP(NULL, 0, 0, 0);
static struct snd_kcontrol_new beep_vol_ctl = static const struct snd_kcontrol_new beep_vol_ctl =
HDA_CODEC_VOLUME(NULL, 0, 0, 0); HDA_CODEC_VOLUME(NULL, 0, 0, 0);
/* check for mute support for the the amp */ /* check for mute support for the the amp */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment