summaryrefslogtreecommitdiff
path: root/include/sound/soc-dapm.h
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-07-26 19:04:59 +0200
committerMark Brown <broonie@kernel.org>2015-07-29 14:01:38 +0100
commit1ce43acff0c078fd560ee0f2a4ae10b8da28e388 (patch)
treee162557def119e3f5c643b6abcb5d308dbfaa8fa /include/sound/soc-dapm.h
parent787126ebdb9821f1a19b1dfd1ab1bbb74b8c80b8 (diff)
ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets()
When running dapm_dai_get_connected_widgets() currently in is_connected_{input,output}_ep() for each widget that gets added the array is resized and the code also loops over all existing entries to avoid adding a widget multiple times. The former can be avoided by collecting the widgets in a linked list and only once we have all widgets allocate the array. The later can be avoided by changing when the widget is added. Currently it is added when walking the neighbor lists of a widget. Since a widget can be neighbors with multiple other widgets it could get added twice and hence the check is necessary. But the main body of is_connected_{input,output}_ep is guaranteed to be only executed at most once per widget. So adding the widget to the list at the beginning of the function automatically makes sure that each widget gets only added once. The only difference is that using this method the starting point itself will also end up on the list, but it can easily be skipped when creating the array. Overall this reduces the code size and speeds things slightly up. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound/soc-dapm.h')
0 files changed, 0 insertions, 0 deletions