ASoC: dapm: Avoid uninitialised variable warning

Commit 4a75aae17b ("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>
This commit is contained in:
Charles Keepax 2018-09-06 17:41:55 +01:00 committed by Mark Brown
parent e058a40332
commit fc269c0396
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 1 additions and 1 deletions

View File

@ -3623,7 +3623,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
struct snd_pcm_hw_params *params = NULL; struct snd_pcm_hw_params *params = NULL;
struct snd_pcm_runtime *runtime = NULL; struct snd_pcm_runtime *runtime = NULL;
unsigned int fmt; unsigned int fmt;
int ret; int ret = 0;
config = rtd->dai_link->params + rtd->params_select; config = rtd->dai_link->params + rtd->params_select;