Skip to content

Commit

Permalink
ASoC: soc-compress: avoid false-positive Wuninitialized warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rong Chen <[email protected]>
Acked-by: Kuninori Morimoto <[email protected]>
Cc: Kuninori Morimoto <[email protected]>
Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%[email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
xilabao authored and broonie committed Apr 24, 2020
1 parent fe57a92 commit 3e645a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/soc-compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3e645a4

Please sign in to comment.