From patchwork Thu Feb 2 16:34:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13126551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95CE5C05027 for ; Thu, 2 Feb 2023 16:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Message-Id:MIME-Version:Subject:Date :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EWeqd6texwtUOv9e13i1Qqt96iE/igrhcMSMHB9JDhk=; b=2U/fkz4LxM1FTS 3xI4K/10An/ibfJSDJTDDOQFHIE1w/mGwNb2Fhq+vKGkQ4BFU+BWIoP+a8xRICowxtnLTNoW6rqYE d1+CiDD14A/QuMvsgaHbRgBM6TM24l6GP1bPQsnHPIUZIhyU3aAwvdlGKoO7uJrn4EOLOMVF0wGrN /Krnob96K8s+AyOdi7uTLDSZsDPur1OBW0/MhgQYdiOg6HZYuF/IiLxnP9p7QQrgCoW/QPQMPfvd1 6XOxvlDewrbf+i/PbmWX92OLnpnjt8CV/Uva/xwrfTzzTWCbRe/5POm2uDBRrHx4QsVG0/mS8vZ9m 9tUQvhR6MuDTPfPyoN/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNcY2-00GfnB-8J; Thu, 02 Feb 2023 16:34:54 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNcXy-00Gfmk-Q4 for linux-arm-kernel@lists.infradead.org; Thu, 02 Feb 2023 16:34:52 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 04DA4B825EE; Thu, 2 Feb 2023 16:34:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B514C433EF; Thu, 2 Feb 2023 16:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675355686; bh=4bpf1y8Gwhp/w9VhMFKg+NgCFgYS/3a8aHv9zIxyUdk=; h=From:Date:Subject:To:Cc:From; b=a8pb53m9EEH4lcl2zbe6hBoYTQA9c27xtXYEhoFxg7e1lH9MiJtbOLBBouPeoSmpR ckznj66rT1B25SnUxOIJ59UHhwUVxFMeztZKuiLAKXa6B+ysdKqMRYieMbIFugkz4U 7vlG7AWufG9p7674WsHIeLdHoY0zaxVwaZV52eDvBF5KGBpRRB3VbvHaOWkMn+h6aV oMwuVWQDWmrj1zIg3TLLHPw9TTCkDURUKIpJTXPeLq89M7bRsJ0o7c4EgLzAs01gy7 /du4bZuLQik1rn5xiL1k5h38sE25t0QJCSUHrifAvdyaceXrc4/fVEcs8ZOAodWZiC KgvAYCXtZlw1w== From: Nathan Chancellor Date: Thu, 02 Feb 2023 09:34:19 -0700 Subject: [PATCH] ASoC: mchp-spdifrx: Fix uninitialized use of mr in mchp_spdifrx_hw_params() MIME-Version: 1.0 Message-Id: <20230202-mchp-spdifrx-fix-uninit-mr-v1-1-629a045d7a2f@kernel.org> X-B4-Tracking: v=1; b=H4sIAAvm22MC/x2NTQqDMBCFryKz7kCaWrC9Sukixkkzi6RhRosg3 t2xmwcf728DJWFSeHYbCP1Y+VsNrpcOYg71Q8iTMXjnb84ES8wNtU2cZMXEKy6VK89YBAd390O yUB8fYANjUMJRQo35nChBZ5LTaELW/L++3vt+AIUW/mGFAAAA To: codrin.ciubotariu@microchip.com, lgirdwood@gmail.com, broonie@kernel.org, claudiu.beznea@microchip.com X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1470; i=nathan@kernel.org; h=from:subject:message-id; bh=4bpf1y8Gwhp/w9VhMFKg+NgCFgYS/3a8aHv9zIxyUdk=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMm3n6kqqfjOfldQz9a39+jF+4pXzLtd8lxfTajM1DKdK XsyJCK9o5SFQYyDQVZMkaX6sepxQ8M5ZxlvnJoEM4eVCWQIAxenAEwkhY/hf5Tv1MuePe38l53T LZ/HbLx4MZdlqlwuY63NGm/RJcltaxkZJqszrOzi0PiSx9EjLJDllJbocFoo9mmq/Bf/cLWtZxr ZAQ== X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230202_083451_049578_C525CC37 X-CRM114-Status: GOOD ( 11.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, alsa-devel@alsa-project.org, trix@redhat.com, llvm@lists.linux.dev, ndesaulniers@google.com, patches@lists.linux.dev, Nathan Chancellor , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Clang warns: ../sound/soc/atmel/mchp-spdifrx.c:455:3: error: variable 'mr' is uninitialized when used here [-Werror,-Wuninitialized] mr |= SPDIFRX_MR_ENDIAN_BIG; ^~ ../sound/soc/atmel/mchp-spdifrx.c:432:8: note: initialize the variable 'mr' to silence this warning u32 mr; ^ = 0 1 error generated. Zero initialize mr so that these bitwise OR and assignment operation works unconditionally. Fixes: fa09fa60385a ("ASoC: mchp-spdifrx: fix controls which rely on rsr register") Link: https://github.com/ClangBuiltLinux/linux/issues/1797 Signed-off-by: Nathan Chancellor Reviewed-by: Claudiu Beznea --- sound/soc/atmel/mchp-spdifrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 1d78f19d90d1932c83d8c96c6f86fbb06c05e29a change-id: 20230202-mchp-spdifrx-fix-uninit-mr-80528f2024c9 Best regards, diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c index 526dd3a17471..eb0c0ef4541e 100644 --- a/sound/soc/atmel/mchp-spdifrx.c +++ b/sound/soc/atmel/mchp-spdifrx.c @@ -429,7 +429,7 @@ static int mchp_spdifrx_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mchp_spdifrx_dev *dev = snd_soc_dai_get_drvdata(dai); - u32 mr; + u32 mr = 0; int ret; dev_dbg(dev->dev, "%s() rate=%u format=%#x width=%u channels=%u\n",