All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Keqiao <keqiao.zhang@intel.com>
To: alsa-devel@alsa-project.org
Cc: keqiao.zhang@intel.com, Zhang Keqiao <keqiaox.k.zhang@linux.intel.com>
Subject: [PATCH] alsabat: fix one uninitialized warning issue
Date: Wed, 30 Aug 2017 09:26:16 +0800	[thread overview]
Message-ID: <20170830012616.25373-1-keqiao.zhang@intel.com> (raw)

From: Zhang Keqiao <keqiaox.k.zhang@linux.intel.com>

Fix a variable uninitialized issue, adding the initialized assignment to fix it.

Signed-off-by: Zhang Keqiao <keqiaox.k.zhang@linux.intel.com>
---
 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;
 
-- 
2.9.3

             reply	other threads:[~2017-08-30  1:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30  1:26 Zhang Keqiao [this message]
2017-08-30  8:19 ` [PATCH] alsabat: fix one uninitialized warning issue Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170830012616.25373-1-keqiao.zhang@intel.com \
    --to=keqiao.zhang@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=keqiaox.k.zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.