[PATCH] ALSA: usb-line6: constify snd_kcontrol_new strucutre array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
 sound/usb/line6/pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c
index fab53f5..b3854f8 100644
--- a/sound/usb/line6/pcm.c
+++ b/sound/usb/line6/pcm.c
@@ -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",
-- 
2.9.3

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux