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: 10722423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A0526C5 for ; Mon, 10 Dec 2018 20:47:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48B842A5F6 for ; Mon, 10 Dec 2018 20:47:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D0A72A7ED; Mon, 10 Dec 2018 20:47:06 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 979F22A5F6 for ; Mon, 10 Dec 2018 20:47:05 +0000 (UTC) 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) 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 X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Kuninori Morimoto --- sound/soc/generic/simple-card-utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }