Skip to contentSkip to conversation

ALSA: led: Use restricted type for iface assignment

PATCH In review Takashi Iwai 2 participants 2 messages Nov 23, 2021 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: led: Use restricted type for iface assignment

Fix a sparse warning that complains about the inconsistent type assignment for iface, which is a restricted type of snd_ctl_elem_iface_t.

Fixes a135dfb5de15 ("ALSA: led control - add sysfs kcontrol LED marking layer")
---
 sound/core/control_led.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/control_led.c +1 -1
index a95332b2b90b..207828f30983 100644
@@ -509,7 +509,7 @@ static char *parse_string(char *s, char *val, size_t val_size)
 	return s;
 }
 
-static char *parse_iface(char *s, unsigned int *val)
+static char *parse_iface(char *s, snd_ctl_elem_iface_t *val)
 {
 	if (!strncasecmp(s, "card", 4))
 		*val = SNDRV_CTL_ELEM_IFACE_CARD;
Signature · 1 line
2.31.1
maintainer
#1 lore raw
Quoted 8 lines · Takashi Iwai

Fix a sparse warning that complains about the inconsistent type assignment for iface, which is a restricted type of snd_ctl_elem_iface_t.

Fixes a135dfb5de15 ("ALSA: led control - add sysfs kcontrol LED marking layer")

Thanks,
Jaroslav

Quoted 18 lines
---
  sound/core/control_led.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/control_led.c +1 -1
index a95332b2b90b..207828f30983 100644
@@ -509,7 +509,7 @@ static char *parse_string(char *s, char *val, size_t val_size)
  	return s;
  }
 
-static char *parse_iface(char *s, unsigned int *val)
+static char *parse_iface(char *s, snd_ctl_elem_iface_t *val)
  {
  	if (!strncasecmp(s, "card", 4))
  		*val = SNDRV_CTL_ELEM_IFACE_CARD;
Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.