All of lore.kernel.org
 help / color / mirror / Atom feed
From: fuweix.tang@intel.com
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com,
	Fuwei Tang <fuweix.tang@intel.com>,
	mengdong.lin@intel.com
Subject: [PATCH 2/4] topology: Remove code parsing index value in paring each object
Date: Thu, 13 Apr 2017 14:52:45 +0800	[thread overview]
Message-ID: <48a65d737ca229024dbb3d317e6a96f72263c917.1492065639.git.fuweix.tang@intel.com> (raw)
In-Reply-To: <cover.1492065639.git.fuweix.tang@intel.com>
In-Reply-To: <cover.1492065639.git.fuweix.tang@intel.com>

From: Fuwei Tang <fuweix.tang@intel.com>

We insert a new element into the object list based on its index value, so we parse
index value in "tplg_elem_new_common" before insert it, and then remove code
parsing index value in parsing each object.

Signed-off-by: Fuwei Tang <fuweix.tang@intel.com>
Reviewed-by: Mengdong Lin <mengdong.lin@linux.intel.com>
---
 src/topology/ctl.c  | 27 ---------------------------
 src/topology/dapm.c |  9 ---------
 src/topology/data.c |  9 ---------
 src/topology/pcm.c  | 36 ------------------------------------
 4 files changed, 81 deletions(-)

diff --git a/src/topology/ctl.c b/src/topology/ctl.c
index 1da3d18..1b160a2 100644
--- a/src/topology/ctl.c
+++ b/src/topology/ctl.c
@@ -397,15 +397,6 @@ int tplg_parse_control_bytes(snd_tplg_t *tplg,
 		if (id[0] == '#')
 			continue;
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "base") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
@@ -538,15 +529,6 @@ int tplg_parse_control_enum(snd_tplg_t *tplg, snd_config_t *cfg,
 		if (id[0] == '#')
 			continue;
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "texts") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
@@ -648,15 +630,6 @@ int tplg_parse_control_mixer(snd_tplg_t *tplg,
 		if (id[0] == '#')
 			continue;
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "channel") == 0) {
 			if (mc->num_channels >= SND_SOC_TPLG_MAX_CHAN) {
 				SNDERR("error: too many channels %s\n",
diff --git a/src/topology/dapm.c b/src/topology/dapm.c
index eef72bb..ba5d9fe 100644
--- a/src/topology/dapm.c
+++ b/src/topology/dapm.c
@@ -483,15 +483,6 @@ int tplg_parse_dapm_widget(snd_tplg_t *tplg,
 		if (id[0] == '#')
 			continue;
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "type") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
diff --git a/src/topology/data.c b/src/topology/data.c
index e2aa38c..7b92cea 100644
--- a/src/topology/data.c
+++ b/src/topology/data.c
@@ -1009,15 +1009,6 @@ int tplg_parse_data(snd_tplg_t *tplg, snd_config_t *cfg,
 			continue;
 		}
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "type") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 5568d57..ed50c9c 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -554,15 +554,6 @@ int tplg_parse_pcm(snd_tplg_t *tplg,
 		if (id[0] == '#')
 			continue;
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "id") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
@@ -654,15 +645,6 @@ int tplg_parse_dai(snd_tplg_t *tplg,
 		if (id[0] == '#')
 			continue;
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "id") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
@@ -804,15 +786,6 @@ int tplg_parse_link(snd_tplg_t *tplg,
 		if (id[0] == '#')
 			continue;
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "id") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
@@ -918,15 +891,6 @@ int tplg_parse_cc(snd_tplg_t *tplg,
 		if (id[0] == '#')
 			continue;
 
-		if (strcmp(id, "index") == 0) {
-			if (snd_config_get_string(n, &val) < 0)
-				return -EINVAL;
-
-			elem->index = atoi(val);
-			tplg_dbg("\t%s: %d\n", id, elem->index);
-			continue;
-		}
-
 		if (strcmp(id, "id") == 0) {
 			if (snd_config_get_string(n, &val) < 0)
 				return -EINVAL;
-- 
2.7.4

  parent reply	other threads:[~2017-04-13  6:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13  6:52 [PATCH 0/4] topology: Support using "index" to group objects when generating binary for kernel fuweix.tang
2017-04-13  6:52 ` [PATCH 1/4] topology: Insert new element based on its index value fuweix.tang
2017-04-13  6:52 ` fuweix.tang [this message]
2017-04-13  6:52 ` [PATCH 3/4] topology: Look up references for an object based on its index fuweix.tang
2017-04-13  6:52 ` [PATCH 4/4] topology: Group elements with the same index value into a block fuweix.tang
2017-04-21 10:58 ` [PATCH 0/4] topology: Support using "index" to group objects when generating binary for kernel Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48a65d737ca229024dbb3d317e6a96f72263c917.1492065639.git.fuweix.tang@intel.com \
    --to=fuweix.tang@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=mengdong.lin@intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.