Skip to content

Commit

Permalink
ALSA: usb-line6: constify snd_kcontrol_new strucutre array
Browse files Browse the repository at this point in the history
In kernel APIs of ALSA control interface, drivers can create a control
element set by a call of snd_ctl_new1() with a template. This template
is known to have const qualifier in general cases.

This commit adds the qualifier to template array, for safer program and
runtime. Application of this change moves the symbol from .data section
to .rodata section.

Cc: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
takaswie authored and tiwai committed Apr 14, 2017
1 parent a87a4d2 commit 1e0f8f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/usb/line6/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ static int snd_line6_control_playback_put(struct snd_kcontrol *kcontrol,
}

/* control definition */
static struct snd_kcontrol_new line6_controls[] = {
static const struct snd_kcontrol_new line6_controls[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Playback Volume",
Expand Down

0 comments on commit 1e0f8f6

Please sign in to comment.