]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: control: Simplify snd_ctl_elem_list() implementation
authorTakashi Iwai <tiwai@suse.de>
Mon, 22 May 2017 15:43:04 +0000 (17:43 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 23 May 2017 05:03:55 +0000 (07:03 +0200)
commitc593bfaec9aa689faa85be83f2a4017f39d69d6d
tree697697b2c5ccd436f4c801458025a21c757c6b43
parent6df20ef25624b766f5da006d02f34e322c61d978
ALSA: control: Simplify snd_ctl_elem_list() implementation

This patch simplifies the code of snd_ctl_elem_list() in the following
ways:

- Avoid a vmalloc() temporary buffer but do copy in each iteration;
  the vmalloc buffer was introduced at the time we took the spinlock
  for the ctl element management.

- Use the standard list_for_each_entry() macro

- Merge two loops into one;
  it used to be a loop for skipping until offset becomes zero and
  another loop to copy the data.  They can be folded into a single
  loop easily.

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