Skip to content

Commit

Permalink
ALSA: aoa: Constify snd_kcontrol_new items
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 3, 2020
1 parent 454f5ec commit dde5199
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sound/aoa/codecs/onyx.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static int onyx_snd_single_bit_put(struct snd_kcontrol *kcontrol,
}

#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, \
.name = description, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
Expand Down
2 changes: 1 addition & 1 deletion sound/aoa/codecs/tas.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol,
}

#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, \
.name = descr " Playback Volume", \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
Expand Down
2 changes: 1 addition & 1 deletion sound/aoa/fabrics/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ static int n##_control_put(struct snd_kcontrol *kcontrol, \
!!ucontrol->value.integer.value[0]); \
return 1; \
} \
static struct snd_kcontrol_new n##_ctl = { \
static const struct snd_kcontrol_new n##_ctl = { \
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.name = description, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
Expand Down

0 comments on commit dde5199

Please sign in to comment.