提交 1e0f8f68 编写于 作者: T Takashi Sakamoto 提交者: Takashi Iwai

ALSA: usb-line6: constify snd_kcontrol_new strucutre array

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: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 a87a4d23
...@@ -430,7 +430,7 @@ static int snd_line6_control_playback_put(struct snd_kcontrol *kcontrol, ...@@ -430,7 +430,7 @@ static int snd_line6_control_playback_put(struct snd_kcontrol *kcontrol,
} }
/* control definition */ /* control definition */
static struct snd_kcontrol_new line6_controls[] = { static const struct snd_kcontrol_new line6_controls[] = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Playback Volume", .name = "PCM Playback Volume",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册