summaryrefslogtreecommitdiffstats
path: root/sound/core/oss/pcm_oss.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-05-21 19:08:57 +0200
committerTakashi Iwai <tiwai@suse.de>2017-06-02 19:38:26 +0200
commitfed5794fccf40297f17e0032cc8211cdad0ba6df (patch)
treee6d974221c06e8e7a361758a034f528d8adedfe0 /sound/core/oss/pcm_oss.c
parent13f72c8c28fc4b2d5329c940086c8939756600c2 (diff)
downloadlinux-0-day-fed5794fccf40297f17e0032cc8211cdad0ba6df.tar.gz
linux-0-day-fed5794fccf40297f17e0032cc8211cdad0ba6df.tar.xz
ALSA: pcm: Build OSS writev/readv helpers conditionally
The snd_pcm_oss_writev3() and snd_pcm_oss_readv3() are used only in io.c with CONFIG_SND_PCM_OSS_PLUGINS=y. Add an ifdef to reduce the build of these functions. Along with it, since they are called always for in-kernel copy, reduce the argument and call snd_pcm_kernel_writev() and *_readv() directly instead. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/oss/pcm_oss.c')
-rw-r--r--sound/core/oss/pcm_oss.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 2d6a825cfe88c..5e1009d959a8b 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1232,7 +1232,8 @@ snd_pcm_sframes_t snd_pcm_oss_read3(struct snd_pcm_substream *substream, char *p
return ret;
}
-snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames, int in_kernel)
+#ifdef CONFIG_SND_PCM_OSS_PLUGINS
+snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames)
{
struct snd_pcm_runtime *runtime = substream->runtime;
int ret;
@@ -1249,8 +1250,7 @@ snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream, void
if (ret < 0)
break;
}
- ret = __snd_pcm_lib_xfer(substream, bufs, false, frames,
- in_kernel);
+ ret = snd_pcm_kernel_writev(substream, bufs, frames);
if (ret != -EPIPE && ret != -ESTRPIPE)
break;
@@ -1262,7 +1262,7 @@ snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream, void
return ret;
}
-snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames, int in_kernel)
+snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames)
{
struct snd_pcm_runtime *runtime = substream->runtime;
int ret;
@@ -1283,13 +1283,13 @@ snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream, void *
if (ret < 0)
break;
}
- ret = __snd_pcm_lib_xfer(substream, bufs, false, frames,
- in_kernel);
+ ret = snd_pcm_kernel_readv(substream, bufs, frames);
if (ret != -EPIPE && ret != -ESTRPIPE)
break;
}
return ret;
}
+#endif /* CONFIG_SND_PCM_OSS_PLUGINS */
static ssize_t snd_pcm_oss_write2(struct snd_pcm_substream *substream, const char *buf, size_t bytes, int in_kernel)
{