mixer: simple - use for loop in base_len()

... reduce the code a bit

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-03-05 21:11:41 +01:00
parent 86b9c67774
commit 829fbf5065

View file

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