aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/oss/linear.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/oss/linear.c')
-rw-r--r--sound/core/oss/linear.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/sound/core/oss/linear.c b/sound/core/oss/linear.c
index da3dbd41669e..4c1d16827199 100644
--- a/sound/core/oss/linear.c
+++ b/sound/core/oss/linear.c
@@ -92,7 +92,8 @@ static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin,
92{ 92{
93 struct linear_priv *data; 93 struct linear_priv *data;
94 94
95 snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO); 95 if (snd_BUG_ON(!plugin || !src_channels || !dst_channels))
96 return -ENXIO;
96 data = (struct linear_priv *)plugin->extra_data; 97 data = (struct linear_priv *)plugin->extra_data;
97 if (frames == 0) 98 if (frames == 0)
98 return 0; 99 return 0;
@@ -100,12 +101,12 @@ static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin,
100 { 101 {
101 unsigned int channel; 102 unsigned int channel;
102 for (channel = 0; channel < plugin->src_format.channels; channel++) { 103 for (channel = 0; channel < plugin->src_format.channels; channel++) {
103 snd_assert(src_channels[channel].area.first % 8 == 0 && 104 if (snd_BUG_ON(src_channels[channel].area.first % 8 ||
104 src_channels[channel].area.step % 8 == 0, 105 src_channels[channel].area.step % 8))
105 return -ENXIO); 106 return -ENXIO;
106 snd_assert(dst_channels[channel].area.first % 8 == 0 && 107 if (snd_BUG_ON(dst_channels[channel].area.first % 8 ||
107 dst_channels[channel].area.step % 8 == 0, 108 dst_channels[channel].area.step % 8))
108 return -ENXIO); 109 return -ENXIO;
109 } 110 }
110 } 111 }
111#endif 112#endif
@@ -154,13 +155,17 @@ int snd_pcm_plugin_build_linear(struct snd_pcm_substream *plug,
154 struct linear_priv *data; 155 struct linear_priv *data;
155 struct snd_pcm_plugin *plugin; 156 struct snd_pcm_plugin *plugin;
156 157
157 snd_assert(r_plugin != NULL, return -ENXIO); 158 if (snd_BUG_ON(!r_plugin))
159 return -ENXIO;
158 *r_plugin = NULL; 160 *r_plugin = NULL;
159 161
160 snd_assert(src_format->rate == dst_format->rate, return -ENXIO); 162 if (snd_BUG_ON(src_format->rate != dst_format->rate))
161 snd_assert(src_format->channels == dst_format->channels, return -ENXIO); 163 return -ENXIO;
162 snd_assert(snd_pcm_format_linear(src_format->format) && 164 if (snd_BUG_ON(src_format->channels != dst_format->channels))
163 snd_pcm_format_linear(dst_format->format), return -ENXIO); 165 return -ENXIO;
166 if (snd_BUG_ON(!snd_pcm_format_linear(src_format->format) ||
167 !snd_pcm_format_linear(dst_format->format)))
168 return -ENXIO;
164 169
165 err = snd_pcm_plugin_build(plug, "linear format conversion", 170 err = snd_pcm_plugin_build(plug, "linear format conversion",
166 src_format, dst_format, 171 src_format, dst_format,