]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: pcm: Convert snd_pcm_sync_ptr() to user_access_begin/user_access_end()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sat, 14 Jun 2025 06:43:17 +0000 (08:43 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 16 Jun 2025 06:25:32 +0000 (08:25 +0200)
commit8629eea901b8a672dd096ca783ece8322701ca5a
treee1b8554120fc81b5303c4afa083ddc5e99821486
parentc72fad73ba497c237fcc0d771d87a2f8447599bb
ALSA: pcm: Convert snd_pcm_sync_ptr() to user_access_begin/user_access_end()

Now that snd_pcm_sync_ptr_get_user() and snd_pcm_sync_ptr_put_user()
are converted to user_access_begin/user_access_end(),
snd_pcm_sync_ptr_get_user() is more efficient than a raw get_user()
followed by a copy_from_user(). And because copy_{to/from}_user() are
generic functions focussed on transfer of big data blocks to/from user,
snd_pcm_sync_ptr_put_user() is also more efficient for small amont of
data.

So use snd_pcm_sync_ptr_get_user() and snd_pcm_sync_ptr_put_user() in
snd_pcm_sync_ptr() too.

snd_pcm_ioctl_sync_ptr_buggy() is left as it is because the conversion
wouldn't be straigh-forward due to the workaround it provides.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/6ce6bc4da498ea7ea2be5f279b374370b1613b13.1749883041.git.christophe.leroy@csgroup.eu
sound/core/pcm_native.c