Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1712772

[PATCH 3/3] ALSA: hda: make snd_kcontrol_new const

From Bhumika Goyal <bhumirks@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 3/3] ALSA: hda: make snd_kcontrol_new const
Date 2017-08-16 10:50 +0200
Message-ID <uf2bw-4Pi-11@gated-at.bofh.it> (permalink)
References <uf2bv-4Pi-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Make these const as they are only passed as the 3rd argument to the
function snd_hda_gen_add_kctl, which is of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 sound/pci/hda/patch_analog.c   | 4 ++--
 sound/pci/hda/patch_sigmatel.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index e0fb8c6..7578573 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -505,7 +505,7 @@ static int ad1983_auto_smux_enum_put(struct snd_kcontrol *kcontrol,
 	return 1;
 }
 
-static struct snd_kcontrol_new ad1983_auto_smux_mixer = {
+static const struct snd_kcontrol_new ad1983_auto_smux_mixer = {
 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 	.name = "IEC958 Playback Source",
 	.info = ad1983_auto_smux_enum_info,
@@ -788,7 +788,7 @@ static int ad1988_auto_smux_enum_put(struct snd_kcontrol *kcontrol,
 	return 1;
 }
 
-static struct snd_kcontrol_new ad1988_auto_smux_mixer = {
+static const struct snd_kcontrol_new ad1988_auto_smux_mixer = {
 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 	.name = "IEC958 Playback Source",
 	.info = ad1988_auto_smux_enum_info,
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 6cefdf6..63d15b5 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -961,7 +961,7 @@ static int stac_smux_enum_put(struct snd_kcontrol *kcontrol,
 				     &spec->cur_smux[smux_idx]);
 }
 
-static struct snd_kcontrol_new stac_smux_mixer = {
+static const struct snd_kcontrol_new stac_smux_mixer = {
 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 	.name = "IEC958 Playback Source",
 	/* count set later */
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] ALSA: make snd_kcontrol_new const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-16 10:50 +0200
  [PATCH 3/3] ALSA: hda: make snd_kcontrol_new const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-16 10:50 +0200
  [PATCH 1/3] ALSA: aoa: make snd_kcontrol_new const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-16 10:50 +0200
  Re: [PATCH 0/3] ALSA: make snd_kcontrol_new const Takashi Iwai <tiwai@suse.de> - 2017-08-16 14:50 +0200

csiph-web