[alsa-devel] [PATCH] ASoC: dapm: Avoid creating kcontrol for params

Mark Brown broonie at kernel.org
Tue Aug 22 13:38:32 CEST 2017


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20170822/4c39362d/attachment-0001.sig>


More information about the Alsa-devel mailing list