From patchwork Thu Nov 2 11:15:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 117788 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1928215edm; Thu, 2 Nov 2017 04:17:39 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rfl4uBnlobKT72xloy1p/eWVyWsu2eL9Z+Nwp3c1031fDCr/kPDeZLxEVsqN9yFCAhKLpN X-Received: by 10.101.64.9 with SMTP id f9mr3264788pgp.114.1509621459527; Thu, 02 Nov 2017 04:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509621459; cv=none; d=google.com; s=arc-20160816; b=vL3JFVjN7de3zjvWaxi8aiQFmX8b5unM3m7lqoPXl91qFJiUD4gDVpg0Dkb5wpTvIB zKVcjfXu/3vHQTanYgOlQuNidqOdFmvaSiUNF2/tEUq2nsvoXbPvi5lmTRGidyV/+DN6 +nQS1S4eYiva77TtSxM4dqy4FElPfrx4ct/KjI+6es4PYQdckJcK7ayeLopRLKJFMU7t Cb+Upc4Hofnt3UxJzTTXm9fN6MdQqwlhDYDK5B2Il3cKOTcJST54UhGR3I8JyX0pxttU RxaiqsAFqnJe0FZO3ktWeGjbDMkIswW77aHp14hlSxJgDNXR8UhKePAJs6aKabmCYfX7 yTsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=P+P526KyY0pQlRXcxTBiuMRtaycdi7IQ9FzJzKqjNLM=; b=Vxztf1qdff55aFrsI+9KZyMzHZ0WsaVLdSP4RJC9S2yo+0l4gb7hXNVj+iLHM6d7U7 BRjUXJHRIV91waAMWefH97APHKI+b5z0Na9Ram4TgLVTv60ERKWiCaOeBe5MtaYw4gL4 YfKIbpQTV7CbgghJLrIVq5Y+Zk7r0PvCcAbe7Lp/a2AbVvplouhq+wLfxvvTsrZdtIAY HXDq+m5DoXhYvfqH/T5pD9tN4Ekf4ztOh9H81TWXtweTZ4sVMjA+6voXxIQdinokqrbE SzXlCkaRbjjc3iAu0PkT9UQek33X4NG3PrwAP7owoWh3Y0zv039gFwgneaolnGxSeZuI Xqqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si3476803pft.267.2017.11.02.04.17.39; Thu, 02 Nov 2017 04:17:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933372AbdKBLRi (ORCPT + 26 others); Thu, 2 Nov 2017 07:17:38 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:55197 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933128AbdKBLRg (ORCPT ); Thu, 2 Nov 2017 07:17:36 -0400 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lv4kw-1d9pN13TZC-010L3o; Thu, 02 Nov 2017 12:16:22 +0100 From: Arnd Bergmann To: Mark Brown Cc: Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Maxime Coquelin , Alexandre Torgue , Olivier Moysan , Dan Carpenter , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: stm32: sai: attempt to fix uninitialized variable Date: Thu, 2 Nov 2017 12:15:48 +0100 Message-Id: <20171102111620.3688534-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:ykv4fy/v4UHt1TS67Iul7AS7pQVmlrrjIcxUdB22w52CIfzXILn Gopvn9jUebMozxt40nyDEjkaLr4hR5l86xAb6ZSsxs+eDzT61Tj/91Nc6F1rkxiZkR4DNjN AyUn57cuF4T10LMh3zp3qwl+sagBpMdhk8ry88AEd4R59wn9n192p0AoYgsNTPnC8OtMH5/ 2VfK+KJ63EtK8PkcRbddA== X-UI-Out-Filterresults: notjunk:1; V01:K0:MYnGNnTDVJc=:d7Rnd1LFq1RdziuZRfaYOl TBeSUYrqJIUy8F9sORnv+nN6ehiL5zfQaQ3Tk2SXTJQHtgxRvC6PWxSAm5fLQr0u1X0F7xEaC yyGQoRb1Htps84qnvbcuouwirLlNgoYDClOG8s5fRH+TSw7BsuEg+qeYFS1PxYHeSO831MKm+ DwCM/y1OIGpa+KtEeHrLmjTqEp+r0V833qxlCagXhrI3ec+7R6Zjapn71pZZ9todhEJDo/RPD 4zOEjtWkTjOu9QnfOGcbmj+kkaF5tWGFH3LM2O+V0tN/JkGYq4TdmZBXfUK1n03L4clrwLp09 nDBz9J+qosZS08ChZXgDXW5PBHh7xmdsInq1a6/UwxkxjvDV3k9RVfRx6IesmkfsZWJRzy/z8 UrUEkzq8/Uk3grKGKjJtDZl+P2TjoACtpRbyhmFcntfZE52ey+bcO7x9bDCQXnUg9CSCmndpz /+6uPNtASYPXwgKY/QR8XBBjmVC5hn1jZ1kH/XPvSI0IG8050cctSKNg6lO8/mdXTYBzX/yqF 5RppqsXpE3EOyZJL8Jj6BF/H0erp0vEuwJGpSH5IUi+iYvrbLnijt67F9Cjp2jGjhOaiKFxFh LcUWmuFZdlpJYP9TUBmpHr7Xfs4izu+r7S2Uhs6uvw6ormBLfJwPhgOoLD1SmyXF79YSu5SJT DkOvXdHSiIrHYxVUpZFSz1c+vz7tf17SYtuxcAcYc1vHjhiMXb164S2KYjkIz8pmjVSyTnLt4 s44/OKjM0STPN6WMQsPEzzGa0By6jKzjRYnAzA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 61fb4ff70377 ("ASoC: stm32: sai: Move static settings to DAI init"), we get a valid warning about the use of an uninitialized variable: sound/soc/stm/stm32_sai_sub.c: In function 'stm32_sai_hw_params': sound/soc/stm/stm32_sai_sub.c:485:7: error: 'cr1' may be used uninitialized in this function [-Werror=maybe-uninitialized] I could not immediately figure out what the code should do instead, this is the hack I applied locally to shut up the warning. It may or may not be correct, please take a look. Fixes: 61fb4ff70377 ("ASoC: stm32: sai: Move static settings to DAI init") Signed-off-by: Arnd Bergmann --- sound/soc/stm/stm32_sai_sub.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index 150ad546d8b9..d8a51fce368a 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -480,6 +480,7 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai, /* Mode, data format and channel config */ cr1_mask = SAI_XCR1_DS_MASK; + cr1 = 0; switch (params_format(params)) { case SNDRV_PCM_FORMAT_S8: cr1 |= SAI_XCR1_DS_SET(SAI_DATASIZE_8);