]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Avoid recalculating the bitmask for SOC_ENUM controls
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 14 Sep 2012 11:57:27 +0000 (13:57 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 19 Sep 2012 02:51:23 +0000 (22:51 -0400)
commit7aac393fd99643aa3de0d6f93f21ad40cd5720c1
treefec3b10d199fab827a8fdf66857e2b6131649a7d
parent04f1801dc46ed770944c3325ca151aa2459bab41
ASoC: Avoid recalculating the bitmask for SOC_ENUM controls

For ENUM controls the bitmask is calculated based on the number of items.
Currently this is done each time the control is accessed. And while the
performance impact of this should be negligible we can easily do better. The
roundup_pow_of_two macro performs the same calculation which is currently done
manually, but it is also possible to use this macro with compile time constants
and so it can be used to initialize static data. So we can use it to initialize
the mask field of a ENUM control during its declaration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc.h
sound/soc/codecs/twl4030.c
sound/soc/soc-core.c
sound/soc/soc-dapm.c