Skip to contentSkip to conversation

ALSA: core: Constify the name in new kcontrols

PATCH In review Mark Brown 2 participants 2 messages Feb 17, 2012 Sound

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ALSA: core: Constify the name in new kcontrols

We never modify it and this lets us use a const string as the name without warnings.

---

I've got some ASoC patches which need this to avoid warnings, if you're OK with it can I apply it via there please?

 include/sound/control.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/sound/control.h +1 -1
index b2796e8..57815f6 100644
@@ -40,7 +40,7 @@ struct snd_kcontrol_new {
 	snd_ctl_elem_iface_t iface;	/* interface identifier */
 	unsigned int device;		/* device/client number */
 	unsigned int subdevice;		/* subdevice (substream) number */
-	unsigned char *name;		/* ASCII name of item */
+	const unsigned char *name;	/* ASCII name of item */
 	unsigned int index;		/* index of item */
 	unsigned int access;		/* access rights */
 	unsigned int count;		/* count of same elements */
Signature · 1 line
1.7.9.rc1
Reviewed-by on v1 1/1
#1 lore raw

At Thu, 16 Feb 2012 17:09:09 -0800,

Quoted 9 lines · Mark Brown

We never modify it and this lets us use a const string as the name without warnings.

---

I've got some ASoC patches which need this to avoid warnings, if you're OK with it can I apply it via there please?

Yeah, the new compile warnings by this change are only in sound/soc/*, so it makes sense to apply via asoc tree with proper fixes. In case it's needed,

thanks,

Takashi

Quoted 20 lines
 include/sound/control.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/sound/control.h +1 -1
index b2796e8..57815f6 100644
@@ -40,7 +40,7 @@ struct snd_kcontrol_new {
 	snd_ctl_elem_iface_t iface;	/* interface identifier */
 	unsigned int device;		/* device/client number */
 	unsigned int subdevice;		/* subdevice (substream) number */
-	unsigned char *name;		/* ASCII name of item */
+	const unsigned char *name;	/* ASCII name of item */
 	unsigned int index;		/* index of item */
 	unsigned int access;		/* access rights */
 	unsigned int count;		/* count of same elements */
Signature · 1 line
1.7.9.rc1