Skip to contentSkip to conversation

ucm: set active_verb when set_verb was successful

PATCH In review [email protected] 2 participants 2 messages Jun 4, 2014 – Jun 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ucm: set active_verb when set_verb was successful

From: Noé Rubinstein <[email protected]>

This seems to be a bug: execute_sequence returns zero on success, therefore the current code changes the active_verb iff execute_sequence failed.

src/ucm/main.c +1 -1
index 0494728..3c0d7e4 100644
@@ -623,7 +623,7 @@ static int set_verb(snd_use_case_mgr_t *uc_mgr,
 			       &verb->value_list,
 			       &uc_mgr->value_list,
 			       NULL);
-	if (enable && err >= 0)
+	if (enable && err == 0)
 		uc_mgr->active_verb = verb;
 	return err;
 }
Signature · 6 lines
1.9.2

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#1 lore raw

At Wed, 4 Jun 2014 18:52:25 +0200,

Quoted 6 lines · [email protected] wrote:

From: Noé Rubinstein <[email protected]>

This seems to be a bug: execute_sequence returns zero on success, therefore the current code changes the active_verb iff execute_sequence failed.

"err >= 0" means "!(err < 0)", that is, if it's not an error. So the current code isn't wrong.

Takashi

Quoted 19 lines
src/ucm/main.c +1 -1
index 0494728..3c0d7e4 100644
@@ -623,7 +623,7 @@ static int set_verb(snd_use_case_mgr_t *uc_mgr,
 			       &verb->value_list,
 			       &uc_mgr->value_list,
 			       NULL);
-	if (enable && err >= 0)
+	if (enable && err == 0)
 		uc_mgr->active_verb = verb;
 	return err;
 }
Signature · 1 line
1.9.2

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel