Skip to contentSkip to conversation

ALSA: make snd_kcontrol_new name a normal string

PATCH In review Arnd Bergmann 2 participants 4 messages Oct 26, 2020 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: make snd_kcontrol_new name a normal string

From: Arnd Bergmann <[email protected]>

When building with W=2, there are lots of warnings about the snd_kcontrol_new name field being an array of 'unsigned char' but initialized to a string:

include/sound/soc.h:93:48: warning: pointer targets in initialization of 'const unsigned char *' from 'char *' differ in signedness [-Wpointer-sign]

Make it a regular 'char *' to avoid flooding the build log with this.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
 include/sound/control.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/sound/control.h +1 -1
index e128cff10dfa..77d9fa10812d 100644
@@ -42,7 +42,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 */
-	const unsigned char *name;	/* ASCII name of item */
+	const 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
2.27.0
#1 lore raw
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When building with W=2, there are lots of warnings about the snd_kcontrol_new name field being an array of 'unsigned char' but initialized to a string:

Quoted 6 lines

include/sound/soc.h:93:48: warning: pointer targets in initialization of 'const unsigned char *' from 'char *' differ in signedness [-Wpointer-sign]

Make it a regular 'char *' to avoid flooding the build log with this.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")

I'm fine to apply this, but I thought we agreed to ignore pointer signedness intentionally? There are lots of such places and we were fed up in the past when gcc complained a lot about those...

thanks,

Takashi

#2 lore raw
Quoted 11 lines · Takashi Iwai
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When building with W=2, there are lots of warnings about the snd_kcontrol_new name field being an array of 'unsigned char' but initialized to a string:

include/sound/soc.h:93:48: warning: pointer targets in initialization of 'const unsigned char *' from 'char *' differ in signedness [-Wpointer-sign]

Quoted 8 lines
Quoted 4 lines

Make it a regular 'char *' to avoid flooding the build log with this.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")

I'm fine to apply this, but I thought we agreed to ignore pointer signedness intentionally? There are lots of such places and we were fed up in the past when gcc complained a lot about those...

I'm only sending fixes for the ones in headers that get included in a lot of places. There are good reasons for building being able to build specific drivers or directories with W=2, but it's less helpful if there are many identical warnings.

Arnd

#3 lore raw
Quoted 18 lines · Arnd Bergmann
Quoted 16 lines · Takashi Iwai
Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When building with W=2, there are lots of warnings about the snd_kcontrol_new name field being an array of 'unsigned char' but initialized to a string:

include/sound/soc.h:93:48: warning: pointer targets in initialization of 'const unsigned char *' from 'char *' differ in signedness [-Wpointer-sign]

Make it a regular 'char *' to avoid flooding the build log with this.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Quoted 8 lines
Quoted 3 lines

I'm fine to apply this, but I thought we agreed to ignore pointer signedness intentionally? There are lots of such places and we were fed up in the past when gcc complained a lot about those...

I'm only sending fixes for the ones in headers that get included in a lot of places. There are good reasons for building being able to build specific drivers or directories with W=2, but it's less helpful if there are many identical warnings.

OK, now I applied the patch. Thanks!

Takashi