alsabat: fix one uninitialized warning issue
diff mbox

Message ID 20170830012616.25373-1-keqiao.zhang@intel.com
State New
Headers show

Commit Message

keqiao.zhang@intel.com Aug. 30, 2017, 1:26 a.m. UTC
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(-)

Comments

Takashi Iwai Aug. 30, 2017, 8:19 a.m. UTC | #1
On Wed, 30 Aug 2017 03:26:16 +0200,
Zhang Keqiao wrote:
> 
> 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>

Applied, thanks.


Takashi

Patch
diff mbox

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;