Re: [alsa-devel] [PATCH] ASoC: dapm: Avoid creating kcontrol for params
When num_params is defined as one in case of codec to codec dai link, there is no point in allocating memory for kcontrol.
Signed-off-by: anish kumar yesanishhere@gmail.com
include/sound/soc-dapm.h | 1 - sound/soc/soc-dapm.c | 147 ++++++++++++++++++++++++-----------------------
This is a very big change and that commit log doesn't describe it in any detail or really motivate it. What exactly does this do and why?
Currently in codec to codec dai link if there are multiple params defined then dapm can use created kcontrol to decide which param to apply at runtime.
However, in case there is only single param configuration then there is no point in creating the kcontrol (this is currently happening) and also there is no point in allocating memory for kcontrol.
In the snd_soc_dapm_new_pcm function, there is memory allocation happening for kcontrol which is later used or not used based on num_param. It is better to not allocate memory when there is only a single configuration. This change is to remedy that anomaly and also it remove unnecessary checks.
On Mon, Aug 21, 2017 at 11:36:24AM -0700, anish kumar wrote:
Currently in codec to codec dai link if there are multiple params defined then dapm can use created kcontrol to decide which param to apply at runtime.
However, in case there is only single param configuration then there is no point in creating the kcontrol (this is currently happening) and also there is no point in allocating memory for kcontrol.
In the snd_soc_dapm_new_pcm function, there is memory allocation happening for kcontrol which is later used or not used based on num_param. It is better to not allocate memory when there is only a single configuration. This change is to remedy that anomaly and also it remove unnecessary checks.
It's really hard to relate this to the change, like I say it's quite a big change and the details of the change aren't clearly explained. Perhaps if it was split up so that there was one patch mostly moving code and another stripping out the checks that might help.
Part of this is that the amount of memory that is being saved is going to be fairly small so the risk of a complicated review is higher.
participants (2)
-
anish kumar
-
Mark Brown