OSDN Git Service

conf: remove dead code in snd_config_get_card()
authorJaroslav Kysela <perex@perex.cz>
Wed, 2 Jun 2021 17:26:47 +0000 (19:26 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 2 Jun 2021 17:27:27 +0000 (19:27 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/confmisc.c

index 3663d16..a561040 100644 (file)
@@ -154,10 +154,10 @@ int snd_config_get_card(const snd_config_t *conf)
        long v;
        int err;
 
-       if ((err = snd_config_get_integer(conf, &v)) < 0) {
+       if (snd_config_get_integer(conf, &v) < 0) {
                if ((err = snd_config_get_string(conf, &str)) < 0) {
-                       snd_config_get_id(conf, &id);
-                       SNDERR("Invalid field %s", id);
+                       if (snd_config_get_id(conf, &id) >= 0)
+                               SNDERR("Invalid field %s", id);
                        return -EINVAL;
                }
                err = snd_card_get_index(str);