]> www.infradead.org Git - users/dwmw2/linux.git/commit
ASoC: component: suppress uninitialized-variable warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 Apr 2020 21:47:31 +0000 (23:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:38 +0000 (17:48 +0200)
commit46448b16f046c252fd226c76ee45f5bb1d914ff7
treeeb1cb62fe0a57ad534da68dea0703caebbabe91f
parent081aa3e99e000d3b5ac27e7af11d6d73a6dae51d
ASoC: component: suppress uninitialized-variable warning

[ Upstream commit be16a0f0dc8fab8e25d9cdbeb4f8f28afc9186d2 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/sound/soc.h