From patchwork Wed Aug 30 01:26:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keqiao.zhang@intel.com X-Patchwork-Id: 9928625 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 BAE166032A for ; Wed, 30 Aug 2017 01:29:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3AA1205F6 for ; Wed, 30 Aug 2017 01:29:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95FDA205FB; Wed, 30 Aug 2017 01:29:57 +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 B3CB2205F6 for ; Wed, 30 Aug 2017 01:29:56 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 48C5926702D; Wed, 30 Aug 2017 03:29:53 +0200 (CEST) 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 D3736267030; Wed, 30 Aug 2017 03:29:51 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by alsa0.perex.cz (Postfix) with ESMTP id C2783266C52 for ; Wed, 30 Aug 2017 03:29:48 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 29 Aug 2017 18:29:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,446,1498546800"; d="scan'208";a="129729524" Received: from zkq-optiplex-9020.sh.intel.com ([10.239.13.132]) by orsmga002.jf.intel.com with ESMTP; 29 Aug 2017 18:29:45 -0700 From: Zhang Keqiao To: alsa-devel@alsa-project.org Date: Wed, 30 Aug 2017 09:26:16 +0800 Message-Id: <20170830012616.25373-1-keqiao.zhang@intel.com> X-Mailer: git-send-email 2.9.3 Cc: keqiao.zhang@intel.com, Zhang Keqiao Subject: [alsa-devel] [PATCH] alsabat: fix one uninitialized warning issue 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 From: Zhang Keqiao Fix a variable uninitialized issue, adding the initialized assignment to fix it. Signed-off-by: Zhang Keqiao --- bat/analyze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bat/analyze.c b/bat/analyze.c index 2b8ca61..9808b73 100644 --- a/bat/analyze.c +++ b/bat/analyze.c @@ -34,7 +34,7 @@ static void check_amplitude(struct bat *bat, float *buf) int i, percent; /* calculate average value */ - for (i = 0, sum = 0.0; i < bat->frames; i++) + for (i = 0, sum = 0.0, average = 0.0; i < bat->frames; i++) sum += buf[i]; average = sum / bat->frames;