Skip to contentSkip to conversation

: make snd_kcontrol_new const

PATCH In review Bhumika Goyal 2 participants 4 messages Aug 16, 2017 – Aug 21, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover : make snd_kcontrol_new const

Make these const. Done using Coccinelle.

Bhumika Goyal (2):
[media] cx88: make snd_kcontrol_new const
[media] solo6x10: make snd_kcontrol_new const

 drivers/media/pci/cx88/cx88-alsa.c         | 2 +-
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 cx88: make snd_kcontrol_new const

Make this const as it only passed as the 1st argument to the function snd_ctl_new1, which is of type const.
Done using Coccinelle.

---
 drivers/media/pci/cx88/cx88-alsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/cx88/cx88-alsa.c +1 -1
index c81fe46..9740326 100644
@@ -799,7 +799,7 @@ static int snd_cx88_alc_put(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 
-static struct snd_kcontrol_new snd_cx88_alc_switch = {
+static const struct snd_kcontrol_new snd_cx88_alc_switch = {
 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 	.name = "Line-In ALC Switch",
 	.info = snd_ctl_boolean_mono_info,
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 solo6x10: make snd_kcontrol_new const

In reply to Bhumika Goyal

Make this const as it is only used during a copy operation. Done using Coccinelle.

---
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/solo6x10/solo6x10-g723.c +1 -1
index 3ca9470..81be1b8 100644
@@ -319,7 +319,7 @@ static int snd_solo_capture_volume_put(struct snd_kcontrol *kcontrol,
 	return 1;
 }
 
-static struct snd_kcontrol_new snd_solo_capture_volume = {
+static const struct snd_kcontrol_new snd_solo_capture_volume = {
 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 	.name = "Capture Volume",
 	.info = snd_solo_capture_volume_info,
Signature · 1 line
1.9.1
maintainer
#3 lore raw

Re: [PATCH 2/2] [media] solo6x10: make snd_kcontrol_new const

Quoted 24 lines · Bhumika Goyal

Make this const as it is only used during a copy operation. Done using Coccinelle.

---
 drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/solo6x10/solo6x10-g723.c +1 -1
index 3ca9470..81be1b8 100644
@@ -319,7 +319,7 @@ static int snd_solo_capture_volume_put(struct snd_kcontrol *kcontrol,
 	return 1;
 }
 
-static struct snd_kcontrol_new snd_solo_capture_volume = {
+static const struct snd_kcontrol_new snd_solo_capture_volume = {
 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 	.name = "Capture Volume",
 	.info = snd_solo_capture_volume_info,
Signature · 1 line
1.9.1