From patchwork Mon Dec 14 12:07:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 105114 Delivered-To: patch@linaro.org Received: by 10.112.73.68 with SMTP id j4csp1426425lbv; Mon, 14 Dec 2015 04:08:04 -0800 (PST) X-Received: by 10.194.94.100 with SMTP id db4mr35000562wjb.85.1450094884667; Mon, 14 Dec 2015 04:08:04 -0800 (PST) Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id z9si45424563wjw.234.2015.12.14.04.08.04; Mon, 14 Dec 2015 04:08:04 -0800 (PST) Received-SPF: neutral (google.com: 77.48.224.243 is neither permitted nor denied by best guess record for domain of alsa-devel-bounces@alsa-project.org) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=neutral (google.com: 77.48.224.243 is neither permitted nor denied by best guess record for domain of alsa-devel-bounces@alsa-project.org) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A12372606DD; Mon, 14 Dec 2015 13:07:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.2.4 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 25D5926043C; Mon, 14 Dec 2015 13:07:51 +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 8DCAB260474; Mon, 14 Dec 2015 13:07:49 +0100 (CET) Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id 3F869260417 for ; Mon, 14 Dec 2015 13:07:42 +0100 (CET) Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1a8Ruj-0004U4-5u; Mon, 14 Dec 2015 12:07:37 +0000 Received: from broonie by debutante with local (Exim 4.86) (envelope-from ) id 1a8Rug-0007Ak-Cf; Mon, 14 Dec 2015 12:07:34 +0000 From: Mark Brown To: Kuninori Morimoto Date: Mon, 14 Dec 2015 12:07:30 +0000 Message-Id: <1450094851-27525-2-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1450094851-27525-1-git-send-email-broonie@kernel.org> References: <1450094851-27525-1-git-send-email-broonie@kernel.org> X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Cc: alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood Subject: [alsa-devel] [PATCH 2/3] rcar: dvc: Avoid use of ret uninitialised 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 We use ret as the return value from the rsnd_dvc_probe() but if there are no child nodes and no errors then we will never initialize ret leading to build warnings. Ensure ret is initialized before we iterate over the child nodes to avoid this. Signed-off-by: Mark Brown --- sound/soc/sh/rcar/dvc.c | 1 + 1 file changed, 1 insertion(+) -- 2.6.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 66aeea8e0069..42e6a230a3d1 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -360,6 +360,7 @@ int rsnd_dvc_probe(struct rsnd_priv *priv) priv->dvc = dvc; i = 0; + ret = 0; for_each_child_of_node(node, np) { dvc = rsnd_dvc_get(priv, i);