]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: core: reduce stack usage related to snd_ctl_new()
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 10 Mar 2015 13:13:31 +0000 (22:13 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 10 Mar 2015 14:29:59 +0000 (15:29 +0100)
commit015c658a3285eea49974e0cbdfd625000215c7d2
treeb3557bdba22cc546c70a7f8df2f20b19b18f3912
parent0faef929319836e363517d193057c49407f75f57
ALSA: core: reduce stack usage related to snd_ctl_new()

The callers of snd_ctl_new() need to have 'struct snd_kcontrol' data,
and pass the data as template. Then, the function allocates the structure
data again and copy from the template. This is a waste of resources.
Especially, the callers use large stack for the template.

This commit removes a need of template for the function, thus, changes
the prototype of snd_ctl_new(). Furthermore, this commit changes
the code of callers, snd_ctl_new1() and snd_ctl_elem_add() for better
shape.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control.c