[igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect()

Petri Latvala petri.latvala at intel.com
Wed Jan 16 11:20:43 UTC 2019


It's not clear to the static analyzer that freq is assigned when
handling the previous frame and then used in the next. In fact, it
wasn't clear to me either before staring at the code for some
minutes. Initializing it to something makes both of us happier.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Paul Kocialkowski <paul.kocialkowski at bootlin.com>
---
 lib/igt_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_audio.c b/lib/igt_audio.c
index 229ce6c6..a0592d53 100644
--- a/lib/igt_audio.c
+++ b/lib/igt_audio.c
@@ -250,7 +250,7 @@ bool audio_signal_detect(struct audio_signal *signal, int channels,
 	int threshold;
 	bool above;
 	int error;
-	int freq;
+	int freq = 0;
 	int max;
 	int c, i, j;
 
-- 
2.19.1



More information about the igt-dev mailing list