From patchwork Mon Dec 10 20:46:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 153345 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3994448ljp; Mon, 10 Dec 2018 12:47:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/V/b5cNSE+wGvRBufcaq+CmDh5m5ltrwP59AHMil2GkqfMheSL4/IV25teuZ2JceyPHydLk X-Received: by 2002:a5d:49cd:: with SMTP id t13mr11190305wrs.144.1544474825496; Mon, 10 Dec 2018 12:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544474825; cv=none; d=google.com; s=arc-20160816; b=qxccna1/SDhLkQsoEee/eUqdKWRhL3Do6ZFsFIsiRzEcaj1l/AIaduWeKrSa3GJzdM HDABPARaLUY20Y7NnQMfC03+E1MkNMibxTjVK3l7vuQirWW9D9D3IvJ39Nen9ccO9kEq mdPFEaGR5J08TsjsDY9L4Yx+qXKX8tRiIpwhcZJubkFuqmWoJPD/gKDXRPAJYVaHULGu yFEQ262IAIai+1MAC4FrjXtziwj9/lTFX4jDuUfIWsSikgiZRMCdZ5YOxy16wUrv1jos VcXJj9uIRNxVEqlg6aN0iumTKkw8ZCQz+Sk7IRtK7cph4ms1ArYm0LqtpGgNJtBq15DV alsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:delivered-to; bh=l9fPULLzwlIlGDgJC4jyzXx8LDoSqUwZ92LgG6SEr3s=; b=WJvByLgzZ+564Zxt0mYPkQL/c9lMyzQY59wc3PKLV2fVPHBkVG5HhHGPpazA6luuth JKQM9asxw6jY0IOfy+izcL9w7+B/mSVfs48mCikySXCy7UCLYYjb9EJlX6QSJ0b0EXZM wrmiLpsjR6oYdbXlxAQgPHSSfpqlJFDh1A7bSy/0ESyg/ataHgnGw/xowQNoe3RHmgdY /m0qw7Uuj/bDwrfaDnWeYcy+lMSRlrIiQ8nLvaTEfSmIKHzm+/4YGt5s3u58b6EnpAWB ifYvCmnEQq94H0xSAbQBCAr7MWLpYWrc0937/3Xdpz2f1sm/CrbDdFQZ5gRSM7qTpJqz dNrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id r18si7695066wrx.107.2018.12.10.12.47.05; Mon, 10 Dec 2018 12:47:05 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0463F267B0E; Mon, 10 Dec 2018 21:47:04 +0100 (CET) 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 40DC7267B20; Mon, 10 Dec 2018 21:47:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE autolearn=disabled version=3.4.0 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by alsa0.perex.cz (Postfix) with ESMTP id 282AB26770D for ; Mon, 10 Dec 2018 21:46:59 +0100 (CET) Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1M2OEq-1gSchP17fC-003yef; Mon, 10 Dec 2018 21:46:45 +0100 From: Arnd Bergmann To: Mark Brown Date: Mon, 10 Dec 2018 21:46:10 +0100 Message-Id: <20181210204640.2407929-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:TaKrS6bVFklw/uV/eUdapwird9EwOGcPBDAbySiL0Fsc2VFkRlU 857KuIQB+T5uHi1WMqMcwjRP+nwnbSiKf9weUp7c89UQmhMvaINs2oRkykiuZyUcriix4iW NtdWfk7vefHPsvzXELA3sZS1d0kSgqBZCBCSaYORaATb6ElOo2aNck/9t3lr7WML9snSSWl rX8JFBoCLfrAsethXJ3Ig== X-UI-Out-Filterresults: notjunk:1; V03:K0:rfqArJOtWeA=:AMeeuePRcfqRbWvJCDPtoI bTeYkccbUBKUOoPYIAOhsRqm9Aca6ETMIGDeR3QwFJRufuQiPgu2P9yvFdkSVN71hxJ48/Ymy wxPdx6fPi72P5JMC4J8meSUZGQSJ0sayIO83LrG4lstUjitR9RRZIHLssKz/ahCuAR2G/gEDf Zi5Di9/LHdIdPr4z5ahJNFXcGOAqFrIU7+4QpEmzrwNiBZhNlXg15+b9oGQKvX/xosoAilq18 6zTBCTl8WBVDsm9AXK9A8zEKFamQEetC05vgOFJYIJf5eSSV/fCGjIYwftc1UO4GUte/5ceqJ 9306UXd+N/c5UEfjfzE/qpH9skBUHtyOmt9hW0+S/eTGPSj4k45DxJxQWVToNFRWqirhCev6F zuBNr3/xUPC5OHXLMaegzjRBIzllPnSYzK85HT5xKKvCRA3DqFFSJbfNgWPp5vLCeBiR2V29H 4JCEchW3nWNJDN96gTlBQx7UDsDj/yP2tNg0FFNyQJ6MCk/av+LYl2UDNrWe5VgDzldPnwado Iqs9n9zA3QPQN+1qfNvZiHFHDOlBPdGZ9yjiC6kv4O6L/xLBmBOW+CtH26lv0QJFQjHT3T5Cg bhYvjD134TP6xG21TC0rrug3+D2e9IsKYrOVqQIrWmqJf8XkfLMfsXzAw6boUF3kFnH7ErjFs 2lTGhDZ0UiZ5o0yP7QQn895W09dagzPMPXgNbIg+9+TxG7Agzj5lHczM9YlyGBKWu/nqVLVss lOnFoAJGYXmlkoKWOjeYuWAuOrtxL1HSP43woQ== Cc: alsa-devel@alsa-project.org, Arnd Bergmann , Kuninori Morimoto , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Katsuhiro Suzuki Subject: [alsa-devel] [PATCH] ASoC: simple-card-utils: fix build warning without CONFIG_OF 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org When CONFIG_OF is disabled, of_graph_parse_endpoint() does not initialize 'info', and gcc can see that: sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_graph_dai': sound/soc/generic/simple-card-utils.c:284:13: error: 'info.port' may be used uninitialized in this function [-Werror=maybe-uninitialized] It's probably best to check the return code anyway, and that also takes care of the warning. Fixes: b6f3fc005a2c ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") Signed-off-by: Arnd Bergmann --- sound/soc/generic/simple-card-utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.20.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 6a31d07976b9..17d8aee43835 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -280,7 +280,10 @@ static int asoc_simple_card_get_dai_id(struct device_node *ep) * Non HDMI sound case, counting port/endpoint on its DT * is enough. Let's count it. */ - of_graph_parse_endpoint(ep, &info); + ret = of_graph_parse_endpoint(ep, &info); + if (ret) + return -ENXIO; + return info.port; }