[PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning
From: Rong Chen
Date: Wed Apr 22 2020 - 03:36:39 EST
gcc-6.5 and earlier show a new warning:
sound/soc/soc-compress.c: In function âsoc_compr_openâ:
sound/soc/soc-compress.c:75:28: warning: âcomponentâ is used uninitialized in this function [-Wuninitialized]
struct snd_soc_component *component, *save = NULL;
^~~~~~~~~
Simplest fix is to initialize it to avoid the warning.
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@xxxxxxxxx
Signed-off-by: Rong Chen <rong.a.chen@xxxxxxxxx>
---
sound/soc/soc-compress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 50062eb79adb..e7bd80ed7f2e 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -72,7 +72,7 @@ static int soc_compr_components_free(struct snd_compr_stream *cstream,
static int soc_compr_open(struct snd_compr_stream *cstream)
{
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
- struct snd_soc_component *component, *save = NULL;
+ struct snd_soc_component *component = NULL, *save = NULL;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
int ret, i;
--
2.20.1