From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8C6EC433E0 for ; Thu, 31 Dec 2020 20:09:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5291E20855 for ; Thu, 31 Dec 2020 20:09:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5291E20855 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fnDnVltHiLLltljxIB4PSM3RJ4OVEgDAQ9aUP6ICTMo=; b=zbuQKsRmzTbrZyREalI6JmVy2 57Ike/HMwKHv8jD/qVJZOtLIUYuwA0cJ963u5Xga/oB3DK74rtTvMQmUMlIhLi0jLKke0A0C8ZIHK 7CpMMaZSqCsLILKcyf/5u8uimGghdVliHcYx5oVEMVCQbu/NMlBdwhVQW7vEcOKURQtyRGnSUxdC2 mD+lJJOKCR0brbHTWropIJiA2doRJWL2xqD1KVlpQEsEiMOQl85ikdZoPsuID/XT77tNyApB3w1t5 B8tP6AqdKu0rpylZpYGyuMc/ay5Vu+WnvkCcjntehFH5dRQsw8Zua+n1J3KpHWWccCRhvoqIS+2Ac hWtG5I+7g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kv4Ek-0004s8-Gv; Thu, 31 Dec 2020 20:07:54 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kv4Ef-0004rj-TG for linux-arm-kernel@lists.infradead.org; Thu, 31 Dec 2020 20:07:52 +0000 Received: by mail-pl1-x631.google.com with SMTP id g3so10406942plp.2 for ; Thu, 31 Dec 2020 12:07:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LUdKDlLlflhborB/8hVdW+VgkZLtdJkIlQCMkULEfnY=; b=q4OSIz/JkJT0Z+P9uVNEenQw9LCMicx+csh5V1YclMspc2ubhEGsY9l8aXWn/1o2D2 tqsq+6zRnIEQMwGOBhYBOR9pibQi2htQPQreoUST292qXMsKVsAGim3LKXZ9E+zMie7M 52pwQiP+QDRiqEfB5yLl54UhEeUJ60jgAJwDEmxEkbKliBbXL/avFooqe6pFZMd1QB1x f3/SsfSySDPPrUOV8ywWsXStpQTqui22/EZnyTuI7YSk7qzrBY3irhTo5l7yn6rfj/Vz GGe2OnNRSe4tThPrYvn4loOQr6sb0xPyFqSteoIbplYoQzmBYtJfo/gJZzG5cX1u/qXP c+Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LUdKDlLlflhborB/8hVdW+VgkZLtdJkIlQCMkULEfnY=; b=kkqgYEKj1f7nRfNh3U/1BzoHgx1sPy7aQ0HP/JMjYzRAB3uwO7AXjiv0nTOr5v1+mi VCmCSpoviloOwNOhGo/8BnNhP76H2RXSZzkKwTaYVtkPSeW4I5EGj5MtfynZltApF+Fu doOa455o9ZTKmfXeIUwW6RjS03LteU0IbGMXmT/FyGS0vTuYWt3UTTWdptqN9amfHNxS ibnZDHSCQcbQi22g1iiTGMxV/uFAdn9IBxn9yNTWgFI/pEopvTqFcTJZq/lYLwv/hj89 6geIoDczQ6RcchGG1EgpaTJjT2VHiDseIuLY7Civ8pZrJH5Sb9PkrsjIs6hl6yhwedUV OccQ== X-Gm-Message-State: AOAM531F2aFbhcq8Fo6ey21OyWoeDcWWdnHqHnMICZ11/vR9iqR0OjSL 3QsArUsUJF0TZUDQa1Qf/os= X-Google-Smtp-Source: ABdhPJzl+Fbw2ZK/0YW+xvW1opW2piy82XGq/LFQSMQzdbhXDr9nGtRYASFfPXeTVmyCnl65miZT/w== X-Received: by 2002:a17:902:6b0a:b029:dc:31af:8dc3 with SMTP id o10-20020a1709026b0ab02900dc31af8dc3mr36249199plk.41.1609445265935; Thu, 31 Dec 2020 12:07:45 -0800 (PST) Received: from Asurada-Nvidia (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id y189sm44418568pfb.155.2020.12.31.12.07.44 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Dec 2020 12:07:45 -0800 (PST) Date: Thu, 31 Dec 2020 12:07:57 -0800 From: Nicolin Chen To: Arnd Bergmann Subject: Re: [PATCH] ASoC: fsl: fix -Wmaybe-uninitialized warning Message-ID: <20201231200756.GA15207@Asurada-Nvidia> References: <20201230154443.656997-1-arnd@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201230154443.656997-1-arnd@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201231_150750_268233_3E5540C7 X-CRM114-Status: GOOD ( 20.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Timur Tabi , Arnd Bergmann , Xiubo Li , Fabio Estevam , Sascha Hauer , Takashi Iwai , Nick Desaulniers , Liam Girdwood , Jaroslav Kysela , clang-built-linux@googlegroups.com, Mark Brown , NXP Linux Team , Pengutronix Kernel Team , Shawn Guo , Nathan Chancellor , Shengjiu Wang , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 30, 2020 at 04:44:15PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Clang points out a code path that returns an undefined value > in an error case: > > sound/soc/fsl/imx-hdmi.c:165:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsom > etimes-uninitialized] > if ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in)) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > sound/soc/fsl/imx-hdmi.c:212:9: note: uninitialized use occurs here > return ret; > > The driver returns -EINVAL for other broken DT properties, so do > it the same way here. > > Fixes: 6a5f850aa83a ("ASoC: fsl: Add imx-hdmi machine driver") > Signed-off-by: Arnd Bergmann > --- > sound/soc/fsl/imx-hdmi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c > index 2c2a76a71940..ede4a9ad1054 100644 > --- a/sound/soc/fsl/imx-hdmi.c > +++ b/sound/soc/fsl/imx-hdmi.c > @@ -164,6 +164,7 @@ static int imx_hdmi_probe(struct platform_device *pdev) > > if ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in)) { > dev_err(&pdev->dev, "Invalid HDMI DAI link\n"); > + ret = -EINVAL; > goto fail; I think Mark has already applied a fix :) https://lkml.org/lkml/2020/12/16/275 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel