[alsa-devel] [PATCH][alsa-lib] topology: fix unused-variable warnings introduced to build_link()

Takashi Sakamoto o-takashi at sakamocchi.jp
Tue Nov 29 16:42:01 CET 2016


A function with unused automatic variables was recently introduced to this
library, then compiler generates below warnings.

pcm.c: In function ‘build_link’:
pcm.c:213:6: warning: unused variable ‘i’ [-Wunused-variable]
  int i, num_hw_configs = 0, err = 0;
      ^
pcm.c:210:43: warning: unused variable ‘cmpnt’ [-Wunused-variable]
  struct snd_soc_tplg_link_cmpnt  *codec, *cmpnt;
                                           ^~~~~
pcm.c:210:35: warning: unused variable ‘codec’ [-Wunused-variable]
  struct snd_soc_tplg_link_cmpnt  *codec, *cmpnt;
                                   ^~~~~
pcm.c:209:20: warning: unused variable ‘ref_elem’ [-Wunused-variable]
  struct tplg_elem *ref_elem = NULL;

This commit removes them.

Fixes: 53f7711769d4("topology: Define a function to build a single physical DAI link")
Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 src/topology/pcm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 2e0a120..8f8a703 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -206,11 +206,9 @@ static int tplg_build_stream_cfg(snd_tplg_t *tplg,
 static int build_link(snd_tplg_t *tplg, struct tplg_elem *elem)
 {
 	struct snd_soc_tplg_link_config *link = elem->link;
-	struct tplg_elem *ref_elem = NULL;
-	struct snd_soc_tplg_link_cmpnt  *codec, *cmpnt;
 	struct tplg_ref *ref;
 	struct list_head *base, *pos;
-	int i, num_hw_configs = 0, err = 0;
+	int num_hw_configs = 0, err = 0;
 
 	err = tplg_build_stream_cfg(tplg, link->stream,
 				    link->num_streams);
-- 
2.9.3



More information about the Alsa-devel mailing list