Commit dde5199c authored by Takashi Iwai's avatar Takashi Iwai

ALSA: aoa: 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-33-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 454f5ec1
...@@ -413,7 +413,7 @@ static int onyx_snd_single_bit_put(struct snd_kcontrol *kcontrol, ...@@ -413,7 +413,7 @@ static int onyx_snd_single_bit_put(struct snd_kcontrol *kcontrol,
} }
#define SINGLE_BIT(n, type, description, address, mask, flags) \ #define SINGLE_BIT(n, type, description, address, mask, flags) \
static struct snd_kcontrol_new n##_control = { \ static const struct snd_kcontrol_new n##_control = { \
.iface = SNDRV_CTL_ELEM_IFACE_##type, \ .iface = SNDRV_CTL_ELEM_IFACE_##type, \
.name = description, \ .name = description, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
......
...@@ -369,7 +369,7 @@ static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol, ...@@ -369,7 +369,7 @@ static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol,
} }
#define MIXER_CONTROL(n,descr,idx) \ #define MIXER_CONTROL(n,descr,idx) \
static struct snd_kcontrol_new n##_control = { \ static const struct snd_kcontrol_new n##_control = { \
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.name = descr " Playback Volume", \ .name = descr " Playback Volume", \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
......
...@@ -655,7 +655,7 @@ static int n##_control_put(struct snd_kcontrol *kcontrol, \ ...@@ -655,7 +655,7 @@ static int n##_control_put(struct snd_kcontrol *kcontrol, \
!!ucontrol->value.integer.value[0]); \ !!ucontrol->value.integer.value[0]); \
return 1; \ return 1; \
} \ } \
static struct snd_kcontrol_new n##_ctl = { \ static const struct snd_kcontrol_new n##_ctl = { \
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.name = description, \ .name = description, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
......
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