diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2018-09-06 19:41:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-20 20:46:05 +0300 |
commit | 0376916b7b2cff6db9566b4db946c43d97064f9e (patch) | |
tree | f6b3234b32bb8bfb24aa40bab51f51a80b3996df | |
parent | 0204720dde67e77d9db67d648736a5f62f26a32d (diff) | |
download | linux-0376916b7b2cff6db9566b4db946c43d97064f9e.tar.xz |
ASoC: dapm: Avoid uninitialised variable warning
[ Upstream commit fc269c0396448cabe1afd648c0b335669aa347b7 ]
Commit 4a75aae17b2a ("ASoC: dapm: Add support for multi-CODEC
CODEC to CODEC links") adds loops that iterate over multiple
CODECs in snd_soc_dai_link_event. This also introduced a compiler
warning for a potentially uninitialised variable in the case
no CODECs are present. This should never be the case as the
DAI link must by definition contain at least 1 CODEC however
probably best to avoid the compiler warning by initialising ret
to zero.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | sound/soc/soc-dapm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ff31d9f9ecd6..7f0b48b36380 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3684,7 +3684,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, struct snd_pcm_hw_params *params = NULL; struct snd_pcm_runtime *runtime = NULL; unsigned int fmt; - int ret; + int ret = 0; if (WARN_ON(!config) || WARN_ON(list_empty(&w->edges[SND_SOC_DAPM_DIR_OUT]) || |