mirror of
https://github.com/alsa-project/alsa-utils
synced 2025-01-03 10:49:44 +01:00
alsatplg: do not do NULL check for string arrays
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
0b8d2dfdcc
commit
f076518254
1 changed files with 21 additions and 24 deletions
|
@ -201,35 +201,32 @@ static int tplg_create_config_template(struct tplg_pre_processor *tplg_pp,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* add integer configs */
|
/* add integer configs */
|
||||||
if (items->int_config_ids)
|
for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
|
||||||
for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
|
if (items->int_config_ids[i]) {
|
||||||
if (items->int_config_ids[i]) {
|
ret = tplg_config_make_add(&child, items->int_config_ids[i],
|
||||||
ret = tplg_config_make_add(&child, items->int_config_ids[i],
|
SND_CONFIG_TYPE_INTEGER, top);
|
||||||
SND_CONFIG_TYPE_INTEGER, top);
|
if (ret < 0)
|
||||||
if (ret < 0)
|
goto err;
|
||||||
goto err;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* add string configs */
|
/* add string configs */
|
||||||
if (items->string_config_ids)
|
for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
|
||||||
for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
|
if (items->string_config_ids[i]) {
|
||||||
if (items->string_config_ids[i]) {
|
ret = tplg_config_make_add(&child, items->string_config_ids[i],
|
||||||
ret = tplg_config_make_add(&child, items->string_config_ids[i],
|
SND_CONFIG_TYPE_STRING, top);
|
||||||
SND_CONFIG_TYPE_STRING, top);
|
if (ret < 0)
|
||||||
if (ret < 0)
|
goto err;
|
||||||
goto err;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* add compound configs */
|
/* add compound configs */
|
||||||
if (items->compound_config_ids)
|
for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++) {
|
||||||
for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++) {
|
if (items->compound_config_ids[i]) {
|
||||||
if (items->compound_config_ids[i]) {
|
ret = tplg_config_make_add(&child, items->compound_config_ids[i],
|
||||||
ret = tplg_config_make_add(&child, items->compound_config_ids[i],
|
SND_CONFIG_TYPE_COMPOUND, top);
|
||||||
SND_CONFIG_TYPE_COMPOUND, top);
|
if (ret < 0)
|
||||||
if (ret < 0)
|
goto err;
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err:
|
err:
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
Loading…
Reference in a new issue