[alsa-devel] [PATCH - ucm 1/1] ucm: set active_verb when set_verb was successful
From: Noé Rubinstein nrubinstein@aldebaran-robotics.com
This seems to be a bug: execute_sequence returns zero on success, therefore the current code changes the active_verb iff execute_sequence failed.
Signed-off-by: Noé Rubinstein nrubinstein@aldebaran-robotics.com
diff --git a/src/ucm/main.c b/src/ucm/main.c index 0494728..3c0d7e4 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -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; }
At Wed, 4 Jun 2014 18:52:25 +0200, nrubinstein@aldebaran-robotics.com wrote:
From: Noé Rubinstein nrubinstein@aldebaran-robotics.com
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
Signed-off-by: Noé Rubinstein nrubinstein@aldebaran-robotics.com
diff --git a/src/ucm/main.c b/src/ucm/main.c index 0494728..3c0d7e4 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -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;
}
1.9.2
participants (2)
-
nrubinstein@aldebaran-robotics.com
-
Takashi Iwai