OSDN Git Service

ASoC: component: suppress uninitialized-variable warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 Apr 2020 21:47:31 +0000 (23:47 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 29 Apr 2020 13:23:16 +0000 (14:23 +0100)
commitbe16a0f0dc8fab8e25d9cdbeb4f8f28afc9186d2
treeb1bc23f8eb4b5474b9fedb371e2dbe8cd437afd8
parenteda12425b266b85a8c4b8f4f25ca8afc7e36070f
ASoC: component: suppress uninitialized-variable warning

Old versions of gcc (tested on gcc-4.8) produce a warning for
correct code:

sound/soc/soc-compress.c: In function 'soc_compr_open':
sound/soc/soc-compress.c:75:28: error: 'component' is used uninitialized in this function [-Werror=uninitialized]
  struct snd_soc_component *component, *save = NULL;

Change the for_each_rtd_components() macro to ensure 'component'
gets initialized to a value the compiler does not complain about.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200428214754.3925368-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h