diff options
Diffstat (limited to 'sound/core/oss/mulaw.c')
-rw-r--r-- | sound/core/oss/mulaw.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/sound/core/oss/mulaw.c b/sound/core/oss/mulaw.c index 77f96194a0ed..f7649d4d950b 100644 --- a/sound/core/oss/mulaw.c +++ b/sound/core/oss/mulaw.c | |||
@@ -252,19 +252,20 @@ static snd_pcm_sframes_t mulaw_transfer(struct snd_pcm_plugin *plugin, | |||
252 | { | 252 | { |
253 | struct mulaw_priv *data; | 253 | struct mulaw_priv *data; |
254 | 254 | ||
255 | snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO); | 255 | if (snd_BUG_ON(!plugin || !src_channels || !dst_channels)) |
256 | return -ENXIO; | ||
256 | if (frames == 0) | 257 | if (frames == 0) |
257 | return 0; | 258 | return 0; |
258 | #ifdef CONFIG_SND_DEBUG | 259 | #ifdef CONFIG_SND_DEBUG |
259 | { | 260 | { |
260 | unsigned int channel; | 261 | unsigned int channel; |
261 | for (channel = 0; channel < plugin->src_format.channels; channel++) { | 262 | for (channel = 0; channel < plugin->src_format.channels; channel++) { |
262 | snd_assert(src_channels[channel].area.first % 8 == 0 && | 263 | if (snd_BUG_ON(src_channels[channel].area.first % 8 || |
263 | src_channels[channel].area.step % 8 == 0, | 264 | src_channels[channel].area.step % 8)) |
264 | return -ENXIO); | 265 | return -ENXIO; |
265 | snd_assert(dst_channels[channel].area.first % 8 == 0 && | 266 | if (snd_BUG_ON(dst_channels[channel].area.first % 8 || |
266 | dst_channels[channel].area.step % 8 == 0, | 267 | dst_channels[channel].area.step % 8)) |
267 | return -ENXIO); | 268 | return -ENXIO; |
268 | } | 269 | } |
269 | } | 270 | } |
270 | #endif | 271 | #endif |
@@ -305,11 +306,14 @@ int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *plug, | |||
305 | struct snd_pcm_plugin_format *format; | 306 | struct snd_pcm_plugin_format *format; |
306 | mulaw_f func; | 307 | mulaw_f func; |
307 | 308 | ||
308 | snd_assert(r_plugin != NULL, return -ENXIO); | 309 | if (snd_BUG_ON(!r_plugin)) |
310 | return -ENXIO; | ||
309 | *r_plugin = NULL; | 311 | *r_plugin = NULL; |
310 | 312 | ||
311 | snd_assert(src_format->rate == dst_format->rate, return -ENXIO); | 313 | if (snd_BUG_ON(src_format->rate != dst_format->rate)) |
312 | snd_assert(src_format->channels == dst_format->channels, return -ENXIO); | 314 | return -ENXIO; |
315 | if (snd_BUG_ON(src_format->channels != dst_format->channels)) | ||
316 | return -ENXIO; | ||
313 | 317 | ||
314 | if (dst_format->format == SNDRV_PCM_FORMAT_MU_LAW) { | 318 | if (dst_format->format == SNDRV_PCM_FORMAT_MU_LAW) { |
315 | format = src_format; | 319 | format = src_format; |
@@ -323,7 +327,8 @@ int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *plug, | |||
323 | snd_BUG(); | 327 | snd_BUG(); |
324 | return -EINVAL; | 328 | return -EINVAL; |
325 | } | 329 | } |
326 | snd_assert(snd_pcm_format_linear(format->format) != 0, return -ENXIO); | 330 | if (snd_BUG_ON(!snd_pcm_format_linear(format->format))) |
331 | return -ENXIO; | ||
327 | 332 | ||
328 | err = snd_pcm_plugin_build(plug, "Mu-Law<->linear conversion", | 333 | err = snd_pcm_plugin_build(plug, "Mu-Law<->linear conversion", |
329 | src_format, dst_format, | 334 | src_format, dst_format, |