From patchwork Tue Sep 12 20:47:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Girdwood X-Patchwork-Id: 9950109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8AA2603F3 for ; Tue, 12 Sep 2017 20:55:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A9D5290C6 for ; Tue, 12 Sep 2017 20:55:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F764290CA; Tue, 12 Sep 2017 20:55:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D25CA290C6 for ; Tue, 12 Sep 2017 20:54:59 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3554226706A; Tue, 12 Sep 2017 22:48:03 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 67DB3267079; Tue, 12 Sep 2017 22:48:01 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by alsa0.perex.cz (Postfix) with ESMTP id 6F36D266B1C for ; Tue, 12 Sep 2017 22:47:57 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 12 Sep 2017 13:47:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,384,1500966000"; d="scan'208"; a="1194400913" Received: from srabicox-mobl.ger.corp.intel.com (HELO loki.ger.corp.intel.com) ([10.252.13.48]) by fmsmga001.fm.intel.com with ESMTP; 12 Sep 2017 13:47:54 -0700 From: Liam Girdwood To: Date: Tue, 12 Sep 2017 21:47:42 +0100 Message-Id: <1505249262-14531-1-git-send-email-liam.r.girdwood@linux.intel.com> X-Mailer: git-send-email 1.9.1 Cc: Takashi Iwai , Liam Girdwood , Pierre-Louis Bossart Subject: [alsa-devel] [PATCH] alsa-lib: topology: fix usage of SND_TPLG_INDEX_ALL when checking routes X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure SND_TPLG_INDEX_ALL is used correctly when checking routes so that connecting routes of different indexes does not emit any warnings. Signed-off-by: Liam Girdwood --- src/topology/dapm.c | 4 ++-- src/topology/elem.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/topology/dapm.c b/src/topology/dapm.c index 66892a6..0ddbf96 100644 --- a/src/topology/dapm.c +++ b/src/topology/dapm.c @@ -279,7 +279,7 @@ int tplg_build_routes(snd_tplg_t *tplg) } if (!tplg_elem_lookup(&tplg->widget_list, route->sink, - SND_TPLG_TYPE_DAPM_WIDGET, elem->index)) { + SND_TPLG_TYPE_DAPM_WIDGET, SND_TPLG_INDEX_ALL)) { SNDERR("warning: undefined sink widget/stream '%s'\n", route->sink); } @@ -302,7 +302,7 @@ int tplg_build_routes(snd_tplg_t *tplg) } if (!tplg_elem_lookup(&tplg->widget_list, route->source, - SND_TPLG_TYPE_DAPM_WIDGET, elem->index)) { + SND_TPLG_TYPE_DAPM_WIDGET, SND_TPLG_INDEX_ALL)) { SNDERR("warning: Undefined source widget/stream '%s'\n", route->source); } diff --git a/src/topology/elem.c b/src/topology/elem.c index 89a4ac9..9a7c7b7 100644 --- a/src/topology/elem.c +++ b/src/topology/elem.c @@ -123,7 +123,7 @@ struct tplg_elem *tplg_elem_lookup(struct list_head *base, const char* id, return elem; /* SND_TPLG_INDEX_ALL is the default value "0" and applicable for all use cases */ - if ((elem->index != SND_TPLG_INDEX_ALL) + if ((index != SND_TPLG_INDEX_ALL) && (elem->index > index)) break; }