From: Rong Chen Date: Fri, 24 Apr 2020 00:54:37 +0000 (+0800) Subject: ASoC: soc-compress: avoid false-positive Wuninitialized warning X-Git-Tag: v5.8-rc1~47^2^2~153 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e645a4add53eec22f3818c9da01c19191525096;p=thirdparty%2Fkernel%2Flinux.git ASoC: soc-compress: avoid false-positive Wuninitialized warning 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 Signed-off-by: Rong Chen Acked-by: Kuninori Morimoto Cc: Kuninori Morimoto Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@intel.com Link: https://lore.kernel.org/r/20200424005437.3941-1-rong.a.chen@intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index ceaf976db0bb7..8431ff72be63f 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 = asoc_rtd_to_cpu(rtd, 0); int ret, i;