From patchwork Tue Jan 30 13:19:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10191801 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 A126E60375 for ; Tue, 30 Jan 2018 13:19:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93968201F5 for ; Tue, 30 Jan 2018 13:19:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8800C289C5; Tue, 30 Jan 2018 13:19:58 +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 686C0201F5 for ; Tue, 30 Jan 2018 13:19:57 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0914D2675EE; Tue, 30 Jan 2018 14:19:55 +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 7A00E2675EE; Tue, 30 Jan 2018 14:19:54 +0100 (CET) Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [195.130.137.89]) by alsa0.perex.cz (Postfix) with ESMTP id 7DB62267232 for ; Tue, 30 Jan 2018 14:19:51 +0100 (CET) Received: from ayla.of.borg ([84.194.104.20]) by laurent.telenet-ops.be with bizsmtp id 4dKp1x01L0SRDqC01dKpKl; Tue, 30 Jan 2018 14:19:50 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1egVpF-0002l6-Tb; Tue, 30 Jan 2018 14:19:49 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1egVpF-0003lO-Sc; Tue, 30 Jan 2018 14:19:49 +0100 From: Geert Uytterhoeven To: Bard Liao , Oder Chiou , Jaroslav Kysela , Takashi Iwai Date: Tue, 30 Jan 2018 14:19:43 +0100 Message-Id: <1517318383-14420-2-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517318383-14420-1-git-send-email-geert@linux-m68k.org> References: <1517318383-14420-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Arnd Bergmann , Liam Girdwood , linux-kernel@vger.kernel.org, Mark Brown , Geert Uytterhoeven Subject: [alsa-devel] [PATCH 2/2] ASoC: rt5514: Fix uninitialized calibration value 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP With gcc-4.1.2, if CONFIG_SND_SOC_RT5514_SPI is not set: sound/soc/codecs/rt5514.c: In function ‘rt5514_dsp_voice_wake_up_put’: sound/soc/codecs/rt5514.c:363: warning: ‘buf[0]’ is used uninitialized in this function sound/soc/codecs/rt5514.c:363: warning: ‘buf[1]’ is used uninitialized in this function sound/soc/codecs/rt5514.c:363: warning: ‘buf[2]’ is used uninitialized in this function sound/soc/codecs/rt5514.c:363: warning: ‘buf[3]’ is used uninitialized in this function Fix this by initializing the buffer with zeroes, to avoid random bits being written to the calibration register later. Fixes: fc9cab05837639ce ("ASoC: rt5514: The DSP clock can be calibrated by the other clock source") Signed-off-by: Geert Uytterhoeven --- sound/soc/codecs/rt5514.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c index 19f01558fbca677f..e5fd0114b1fd4d85 100644 --- a/sound/soc/codecs/rt5514.c +++ b/sound/soc/codecs/rt5514.c @@ -358,6 +358,7 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol, #else dev_err(codec->dev, "There is no SPI driver for" " loading the firmware\n"); + memset(buf, 0, sizeof(buf)); #endif rt5514->pll3_cal_value = buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24;