Skip to content

Commit 6c0217b

Browse files
committed
ALSA: pcm: Drop obsoleted PCM copy_user and copy_kernel ops
Finally all users have been converted to the new PCM copy ops, let's drop the obsoleted copy_kernel and copy_user ops completely. Link: https://lore.kernel.org/r/20230815190136.8987-26-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 205d3e0 commit 6c0217b

3 files changed

Lines changed: 2 additions & 23 deletions

File tree

include/sound/pcm.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ struct snd_pcm_ops {
7171
unsigned long pos, unsigned long bytes);
7272
int (*copy)(struct snd_pcm_substream *substream, int channel,
7373
unsigned long pos, struct iov_iter *iter, unsigned long bytes);
74-
int (*copy_user)(struct snd_pcm_substream *substream, int channel,
75-
unsigned long pos, void __user *buf,
76-
unsigned long bytes);
77-
int (*copy_kernel)(struct snd_pcm_substream *substream, int channel,
78-
unsigned long pos, void *buf, unsigned long bytes);
7974
struct page *(*page)(struct snd_pcm_substream *substream,
8075
unsigned long offset);
8176
int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);

sound/core/pcm_lib.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,19 +2031,6 @@ static int default_read_copy(struct snd_pcm_substream *substream,
20312031
return 0;
20322032
}
20332033

2034-
/* a wrapper for calling old copy_kernel or copy_user ops */
2035-
static int call_old_copy(struct snd_pcm_substream *substream,
2036-
int channel, unsigned long hwoff,
2037-
struct iov_iter *iter, unsigned long bytes)
2038-
{
2039-
if (iov_iter_is_kvec(iter))
2040-
return substream->ops->copy_kernel(substream, channel, hwoff,
2041-
iter_iov_addr(iter), bytes);
2042-
else
2043-
return substream->ops->copy_user(substream, channel, hwoff,
2044-
iter_iov_addr(iter), bytes);
2045-
}
2046-
20472034
/* call transfer with the filled iov_iter */
20482035
static int do_transfer(struct snd_pcm_substream *substream, int c,
20492036
unsigned long hwoff, void *data, unsigned long bytes,
@@ -2147,7 +2134,7 @@ static int pcm_sanity_check(struct snd_pcm_substream *substream)
21472134
if (PCM_RUNTIME_CHECK(substream))
21482135
return -ENXIO;
21492136
runtime = substream->runtime;
2150-
if (snd_BUG_ON(!substream->ops->copy && !substream->ops->copy_user && !runtime->dma_area))
2137+
if (snd_BUG_ON(!substream->ops->copy && !runtime->dma_area))
21512138
return -EINVAL;
21522139
if (runtime->state == SNDRV_PCM_STATE_OPEN)
21532140
return -EBADFD;
@@ -2255,9 +2242,6 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
22552242
} else {
22562243
if (substream->ops->copy)
22572244
transfer = substream->ops->copy;
2258-
else if ((in_kernel && substream->ops->copy_kernel) ||
2259-
(!in_kernel && substream->ops->copy_user))
2260-
transfer = call_old_copy;
22612245
else
22622246
transfer = is_playback ?
22632247
default_write_copy : default_read_copy;

sound/core/pcm_native.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
809809
runtime->boundary *= 2;
810810

811811
/* clear the buffer for avoiding possible kernel info leaks */
812-
if (runtime->dma_area && !substream->ops->copy && !substream->ops->copy_user) {
812+
if (runtime->dma_area && !substream->ops->copy) {
813813
size_t size = runtime->dma_bytes;
814814

815815
if (runtime->info & SNDRV_PCM_INFO_MMAP)

0 commit comments

Comments
 (0)