aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/oss/copy.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 11:09:09 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-13 05:46:35 -0400
commit7eaa943c8ed8e91e05d0f5d0dc7a18e3319b45cf (patch)
tree51d86a4cb01cf5735b18c36ca62471f8c759a041 /sound/core/oss/copy.c
parent5ef03460a6ffc1d3ee6b6f2abc6765d3e224cf89 (diff)
ALSA: Kill snd_assert() in sound/core/*
Kill snd_assert() in sound/core/*, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/core/oss/copy.c')
-rw-r--r--sound/core/oss/copy.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/sound/core/oss/copy.c b/sound/core/oss/copy.c
index 9ded30d0e97d..05b58d4fc2b7 100644
--- a/sound/core/oss/copy.c
+++ b/sound/core/oss/copy.c
@@ -32,17 +32,18 @@ static snd_pcm_sframes_t copy_transfer(struct snd_pcm_plugin *plugin,
32 unsigned int channel; 32 unsigned int channel;
33 unsigned int nchannels; 33 unsigned int nchannels;
34 34
35 snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO); 35 if (snd_BUG_ON(!plugin || !src_channels || !dst_channels))
36 return -ENXIO;
36 if (frames == 0) 37 if (frames == 0)
37 return 0; 38 return 0;
38 nchannels = plugin->src_format.channels; 39 nchannels = plugin->src_format.channels;
39 for (channel = 0; channel < nchannels; channel++) { 40 for (channel = 0; channel < nchannels; channel++) {
40 snd_assert(src_channels->area.first % 8 == 0 && 41 if (snd_BUG_ON(src_channels->area.first % 8 ||
41 src_channels->area.step % 8 == 0, 42 src_channels->area.step % 8))
42 return -ENXIO); 43 return -ENXIO;
43 snd_assert(dst_channels->area.first % 8 == 0 && 44 if (snd_BUG_ON(dst_channels->area.first % 8 ||
44 dst_channels->area.step % 8 == 0, 45 dst_channels->area.step % 8))
45 return -ENXIO); 46 return -ENXIO;
46 if (!src_channels->enabled) { 47 if (!src_channels->enabled) {
47 if (dst_channels->wanted) 48 if (dst_channels->wanted)
48 snd_pcm_area_silence(&dst_channels->area, 0, frames, plugin->dst_format.format); 49 snd_pcm_area_silence(&dst_channels->area, 0, frames, plugin->dst_format.format);
@@ -66,15 +67,20 @@ int snd_pcm_plugin_build_copy(struct snd_pcm_substream *plug,
66 struct snd_pcm_plugin *plugin; 67 struct snd_pcm_plugin *plugin;
67 int width; 68 int width;
68 69
69 snd_assert(r_plugin != NULL, return -ENXIO); 70 if (snd_BUG_ON(!r_plugin))
71 return -ENXIO;
70 *r_plugin = NULL; 72 *r_plugin = NULL;
71 73
72 snd_assert(src_format->format == dst_format->format, return -ENXIO); 74 if (snd_BUG_ON(src_format->format != dst_format->format))
73 snd_assert(src_format->rate == dst_format->rate, return -ENXIO); 75 return -ENXIO;
74 snd_assert(src_format->channels == dst_format->channels, return -ENXIO); 76 if (snd_BUG_ON(src_format->rate != dst_format->rate))
77 return -ENXIO;
78 if (snd_BUG_ON(src_format->channels != dst_format->channels))
79 return -ENXIO;
75 80
76 width = snd_pcm_format_physical_width(src_format->format); 81 width = snd_pcm_format_physical_width(src_format->format);
77 snd_assert(width > 0, return -ENXIO); 82 if (snd_BUG_ON(width <= 0))
83 return -ENXIO;
78 84
79 err = snd_pcm_plugin_build(plug, "copy", src_format, dst_format, 85 err = snd_pcm_plugin_build(plug, "copy", src_format, dst_format,
80 0, &plugin); 86 0, &plugin);