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: 10038497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 573CC60291 for ; Thu, 2 Nov 2017 11:16:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B9FD28F04 for ; Thu, 2 Nov 2017 11:16:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 405CC28F06; Thu, 2 Nov 2017 11:16:40 +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=-1.9 required=2.0 tests=BAYES_00, 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 5E0C328F04 for ; Thu, 2 Nov 2017 11:16:39 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A666D267429; Thu, 2 Nov 2017 12:16:36 +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 BC9DE26742D; Thu, 2 Nov 2017 12:16:35 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by alsa0.perex.cz (Postfix) with ESMTP id 0E7D126737F for ; Thu, 2 Nov 2017 12:16:33 +0100 (CET) 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 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== Cc: alsa-devel@alsa-project.org, Olivier Moysan , Alexandre Torgue , Arnd Bergmann , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Dan Carpenter Subject: [alsa-devel] [PATCH] ASoC: stm32: sai: attempt to fix uninitialized variable 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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);