Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp793781rwb; Fri, 23 Sep 2022 04:22:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zk0BxAkheBf0B+l/ft6Jicko8lyJpEzvNrZSU4Mdhl4rrvtoFVVxjRE3krSnJ6C24PS99 X-Received: by 2002:a05:6402:f0f:b0:451:1ecd:a61f with SMTP id i15-20020a0564020f0f00b004511ecda61fmr7888000eda.125.1663932162212; Fri, 23 Sep 2022 04:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663932162; cv=none; d=google.com; s=arc-20160816; b=NbvEKksPRv2vvi/3+JvUVksOVrd+B5IwIwmlm8nus9FtUKVKMJq9WUaxcn0Rl0zEag 8DBDn6TgqlBUKjFGg2Mf7JQ5tgIEp22PklJa3XrIB/7seFVLqKogFdRrs7dlvFiiFWva 97gw6LzSmPo6MXPlcsrSAiMgB1Et+naSDW1Pd/KEyZarrSVXo4WQZA6F/94aqhe6Rm9k q9EOPLqb77Re84s99Yuc5WclcJ/C4mtIbDiWclkIvEdRiyzZzeUjx9rMbiPTA6ofLzlK tJSd9G3TbtwDSdEoPTB5nHOSgKEELeG+gDzJUs2Uz/DDr3fTLEEBaJkUndmtt8M8T32b TjOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=CSW5tYEm3upO2qy3RbhUGDurgdCd3n6vP198X3gP3CI=; b=x51nEAznHkvujxLX+NBnlWsZqnwfztteVPzSOGcIE/xbEwc1LrFy/HD0+A4n4OsWr/ cD+vZfrHWqucj0wr0CxV5JKmoqYsD8QGt5RIjnhBt5+O7B0uoyuuEOuqM54G4lppwPVP NHhItBUnqQZ+bU4CAN1/WBdccNpFTm+MjLixEIOrii3wwPg0SoHwcouxGrfnPZJIUMob zzvoP6NrnXHg0RWy2+x8IFy6r7eMMhDIlAKHPdnQVm9AgFfxJMpYSUKCpbJCCta8/Ell egUNQpTZsb0EBjexRGbPXuEz4KXH43MJkJJD0ZGxRbKez986jOaOYtz1V2WdETm69EIn yT0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt28-20020a170906dfdc00b00733e46f4543si5906869ejc.820.2022.09.23.04.22.16; Fri, 23 Sep 2022 04:22:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231206AbiIWKe6 (ORCPT + 99 others); Fri, 23 Sep 2022 06:34:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbiIWKet (ORCPT ); Fri, 23 Sep 2022 06:34:49 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0BB3192BB for ; Fri, 23 Sep 2022 03:34:46 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B12451B7BF5; Fri, 23 Sep 2022 12:34:44 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6605C1A0F3B; Fri, 23 Sep 2022 12:34:44 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 978121820F5A; Fri, 23 Sep 2022 18:34:42 +0800 (+08) From: Shengjiu Wang To: nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, shengjiu.wang@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, s.hauer@pengutronix.de Subject: [RESEND PATCH] ASoC: fsl_asrc_dma: fully initialize structs Date: Fri, 23 Sep 2022 18:15:47 +0800 Message-Id: <1663928147-10106-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sascha Hauer The driver uses two statically ininitialized struct dma_slave_config, but only one of them is initialized to zero. Initialize config_be to zero as well to make sure that no fields are filled with random values. Let the compiler do this instead of explicitly calling memset() which makes it easier to read. Signed-off-by: Sascha Hauer Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc_dma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c index 12ddf2320f2d..3b81a465814a 100644 --- a/sound/soc/fsl/fsl_asrc_dma.c +++ b/sound/soc/fsl/fsl_asrc_dma.c @@ -139,7 +139,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component, struct dma_chan *tmp_chan = NULL, *be_chan = NULL; struct snd_soc_component *component_be = NULL; struct fsl_asrc *asrc = pair->asrc; - struct dma_slave_config config_fe, config_be; + struct dma_slave_config config_fe = {}, config_be = {}; struct sdma_peripheral_config audio_config; enum asrc_pair_index index = pair->index; struct device *dev = component->dev; @@ -183,7 +183,6 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component, return -EINVAL; } - memset(&config_fe, 0, sizeof(config_fe)); ret = snd_dmaengine_pcm_prepare_slave_config(substream, params, &config_fe); if (ret) { dev_err(dev, "failed to prepare DMA config for Front-End\n"); -- 2.34.1