ASoC: dapm: Drop always true checks
authorLars-Peter Clausen <lars@metafoo.de>
Sun, 26 Jul 2015 17:04:58 +0000 (19:04 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 29 Jul 2015 13:01:37 +0000 (14:01 +0100)
list_first_entry() always returns non NULL and since the code previously
checked that list is not empty it will also be a valid pointer. Furthermore
a path has always a sink or a source widget. So both checks are redundant
and can be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-dapm.c

index cb4bc1cd50492460369f24e7ffb6e3d3392fb3da..f80b7ded0721ac9c7cca2ce66451abbf0c573ddb 100644 (file)
@@ -3482,11 +3482,6 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
        sink_p = list_first_entry(&w->sinks, struct snd_soc_dapm_path,
                                  list_source);
 
-       if (WARN_ON(!source_p || !sink_p) ||
-           WARN_ON(!sink_p->source || !source_p->sink) ||
-           WARN_ON(!source_p->source || !sink_p->sink))
-               return -EINVAL;
-
        source = source_p->source->priv;
        sink = sink_p->sink->priv;