]> git.alsa-project.org Git - alsa-lib.git/commitdiff
mixer: simple - use for loop in base_len()
authorJaroslav Kysela <perex@perex.cz>
Fri, 5 Mar 2021 20:11:41 +0000 (21:11 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 7 Mar 2021 19:28:03 +0000 (20:28 +0100)
... reduce the code a bit

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/mixer/simple_none.c

index 01e9eb2d28fce033992a72aba2cedfa74bb646c7..71d88486f19f9311b05d28e75f73173b41c57521 100644 (file)
@@ -913,8 +913,7 @@ static int base_len(const char *name, selem_ctl_type_t *type)
        const struct suf *p;
        size_t nlen = strlen(name);
 
-       p = suffixes;
-       while (p->suffix) {
+       for (p = suffixes; p->suffix; p++) {
                size_t slen = strlen(p->suffix);
                size_t l;
                if (nlen > slen) {
@@ -925,7 +924,6 @@ static int base_len(const char *name, selem_ctl_type_t *type)
                                return l;
                        }
                }
-               p++;
        }
 
        /* exception: "Capture Volume" and "Capture Switch" */