]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsatplg: do not do NULL check for string arrays
authorJaroslav Kysela <perex@perex.cz>
Fri, 18 Jun 2021 08:15:46 +0000 (10:15 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 18 Jun 2021 08:15:46 +0000 (10:15 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/pre-process-object.c

index ff985e7818f340a063bbdb44e0998b2cf11f9cfd..f479aa48a8be5fc113b86cc2553d7cc344bae45b 100644 (file)
@@ -201,35 +201,32 @@ static int tplg_create_config_template(struct tplg_pre_processor *tplg_pp,
                return ret;
 
        /* add integer configs */
-       if (items->int_config_ids)
-               for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
-                       if (items->int_config_ids[i]) {
-                               ret = tplg_config_make_add(&child, items->int_config_ids[i],
-                                                          SND_CONFIG_TYPE_INTEGER, top);
-                               if (ret < 0)
-                                       goto err;
-                       }
+       for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
+               if (items->int_config_ids[i]) {
+                       ret = tplg_config_make_add(&child, items->int_config_ids[i],
+                                                  SND_CONFIG_TYPE_INTEGER, top);
+                       if (ret < 0)
+                               goto err;
+               }
 
        /* add string configs */
-       if (items->string_config_ids)
-               for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
-                       if (items->string_config_ids[i]) {
-                               ret = tplg_config_make_add(&child, items->string_config_ids[i],
-                                                          SND_CONFIG_TYPE_STRING, top);
-                               if (ret < 0)
-                                       goto err;
-                       }
+       for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
+               if (items->string_config_ids[i]) {
+                       ret = tplg_config_make_add(&child, items->string_config_ids[i],
+                                                  SND_CONFIG_TYPE_STRING, top);
+                       if (ret < 0)
+                               goto err;
+               }
 
        /* add compound configs */
-       if (items->compound_config_ids)
-               for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++) {
-                       if (items->compound_config_ids[i]) {
-                               ret = tplg_config_make_add(&child, items->compound_config_ids[i],
-                                                          SND_CONFIG_TYPE_COMPOUND, top);
-                               if (ret < 0)
-                                       goto err;
-                       }
+       for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++) {
+               if (items->compound_config_ids[i]) {
+                       ret = tplg_config_make_add(&child, items->compound_config_ids[i],
+                                                  SND_CONFIG_TYPE_COMPOUND, top);
+                       if (ret < 0)
+                               goto err;
                }
+       }
 
 err:
        if (ret < 0) {