Skip to contentSkip to conversation

ALSA: hda - check proper return value

PATCH In review Wang Xingchao 2 participants 2 messages Jun 7, 2012 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda - check proper return value

snd_hda_param_read() return value -1 means error, others are responses

---
 sound/pci/hda/hda_proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_proc.c +1 -1
index 79d0188..99316a7 100644
@@ -451,7 +451,7 @@ static void print_power_state(struct snd_info_buffer *buffer,
 	int sup = snd_hda_param_read(codec, nid, AC_PAR_POWER_STATE);
 	int pwr = snd_hda_codec_read(codec, nid, 0,
 				     AC_VERB_GET_POWER_STATE, 0);
-	if (sup)
+	if (sup != -1)
 		snd_iprintf(buffer, "  Power states: %s\n",
 			    bits_names(sup, names, ARRAY_SIZE(names)));
 
Signature · 1 line
1.7.9.5
#1 lore raw

At Thu, 7 Jun 2012 16:52:07 +0800,

Quoted 4 lines · Wang Xingchao

snd_hda_param_read() return value -1 means error, others are responses

Applied now. Thanks.

Takashi

Quoted 20 lines
---
 sound/pci/hda/hda_proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_proc.c +1 -1
index 79d0188..99316a7 100644
@@ -451,7 +451,7 @@ static void print_power_state(struct snd_info_buffer *buffer,
 	int sup = snd_hda_param_read(codec, nid, AC_PAR_POWER_STATE);
 	int pwr = snd_hda_codec_read(codec, nid, 0,
 				     AC_VERB_GET_POWER_STATE, 0);
-	if (sup)
+	if (sup != -1)
 		snd_iprintf(buffer, "  Power states: %s\n",
 			    bits_names(sup, names, ARRAY_SIZE(names)));
 
Signature · 1 line
1.7.9.5