diff options
Diffstat (limited to 'sound/core/seq/seq_timer.c')
-rw-r--r-- | sound/core/seq/seq_timer.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c index d8fcd62e400f..f745c317d6af 100644 --- a/sound/core/seq/seq_timer.c +++ b/sound/core/seq/seq_timer.c | |||
@@ -173,7 +173,8 @@ int snd_seq_timer_set_tempo(struct snd_seq_timer * tmr, int tempo) | |||
173 | { | 173 | { |
174 | unsigned long flags; | 174 | unsigned long flags; |
175 | 175 | ||
176 | snd_assert(tmr, return -EINVAL); | 176 | if (snd_BUG_ON(!tmr)) |
177 | return -EINVAL; | ||
177 | if (tempo <= 0) | 178 | if (tempo <= 0) |
178 | return -EINVAL; | 179 | return -EINVAL; |
179 | spin_lock_irqsave(&tmr->lock, flags); | 180 | spin_lock_irqsave(&tmr->lock, flags); |
@@ -190,7 +191,8 @@ int snd_seq_timer_set_ppq(struct snd_seq_timer * tmr, int ppq) | |||
190 | { | 191 | { |
191 | unsigned long flags; | 192 | unsigned long flags; |
192 | 193 | ||
193 | snd_assert(tmr, return -EINVAL); | 194 | if (snd_BUG_ON(!tmr)) |
195 | return -EINVAL; | ||
194 | if (ppq <= 0) | 196 | if (ppq <= 0) |
195 | return -EINVAL; | 197 | return -EINVAL; |
196 | spin_lock_irqsave(&tmr->lock, flags); | 198 | spin_lock_irqsave(&tmr->lock, flags); |
@@ -214,7 +216,8 @@ int snd_seq_timer_set_position_tick(struct snd_seq_timer *tmr, | |||
214 | { | 216 | { |
215 | unsigned long flags; | 217 | unsigned long flags; |
216 | 218 | ||
217 | snd_assert(tmr, return -EINVAL); | 219 | if (snd_BUG_ON(!tmr)) |
220 | return -EINVAL; | ||
218 | 221 | ||
219 | spin_lock_irqsave(&tmr->lock, flags); | 222 | spin_lock_irqsave(&tmr->lock, flags); |
220 | tmr->tick.cur_tick = position; | 223 | tmr->tick.cur_tick = position; |
@@ -229,7 +232,8 @@ int snd_seq_timer_set_position_time(struct snd_seq_timer *tmr, | |||
229 | { | 232 | { |
230 | unsigned long flags; | 233 | unsigned long flags; |
231 | 234 | ||
232 | snd_assert(tmr, return -EINVAL); | 235 | if (snd_BUG_ON(!tmr)) |
236 | return -EINVAL; | ||
233 | 237 | ||
234 | snd_seq_sanity_real_time(&position); | 238 | snd_seq_sanity_real_time(&position); |
235 | spin_lock_irqsave(&tmr->lock, flags); | 239 | spin_lock_irqsave(&tmr->lock, flags); |
@@ -244,7 +248,8 @@ int snd_seq_timer_set_skew(struct snd_seq_timer *tmr, unsigned int skew, | |||
244 | { | 248 | { |
245 | unsigned long flags; | 249 | unsigned long flags; |
246 | 250 | ||
247 | snd_assert(tmr, return -EINVAL); | 251 | if (snd_BUG_ON(!tmr)) |
252 | return -EINVAL; | ||
248 | 253 | ||
249 | /* FIXME */ | 254 | /* FIXME */ |
250 | if (base != SKEW_BASE) { | 255 | if (base != SKEW_BASE) { |
@@ -265,7 +270,8 @@ int snd_seq_timer_open(struct snd_seq_queue *q) | |||
265 | int err; | 270 | int err; |
266 | 271 | ||
267 | tmr = q->timer; | 272 | tmr = q->timer; |
268 | snd_assert(tmr != NULL, return -EINVAL); | 273 | if (snd_BUG_ON(!tmr)) |
274 | return -EINVAL; | ||
269 | if (tmr->timeri) | 275 | if (tmr->timeri) |
270 | return -EBUSY; | 276 | return -EBUSY; |
271 | sprintf(str, "sequencer queue %i", q->queue); | 277 | sprintf(str, "sequencer queue %i", q->queue); |
@@ -302,7 +308,8 @@ int snd_seq_timer_close(struct snd_seq_queue *q) | |||
302 | struct snd_seq_timer *tmr; | 308 | struct snd_seq_timer *tmr; |
303 | 309 | ||
304 | tmr = q->timer; | 310 | tmr = q->timer; |
305 | snd_assert(tmr != NULL, return -EINVAL); | 311 | if (snd_BUG_ON(!tmr)) |
312 | return -EINVAL; | ||
306 | if (tmr->timeri) { | 313 | if (tmr->timeri) { |
307 | snd_timer_stop(tmr->timeri); | 314 | snd_timer_stop(tmr->timeri); |
308 | snd_timer_close(tmr->timeri); | 315 | snd_timer_close(tmr->timeri); |
@@ -328,7 +335,8 @@ static int initialize_timer(struct snd_seq_timer *tmr) | |||
328 | unsigned long freq; | 335 | unsigned long freq; |
329 | 336 | ||
330 | t = tmr->timeri->timer; | 337 | t = tmr->timeri->timer; |
331 | snd_assert(t, return -EINVAL); | 338 | if (snd_BUG_ON(!t)) |
339 | return -EINVAL; | ||
332 | 340 | ||
333 | freq = tmr->preferred_resolution; | 341 | freq = tmr->preferred_resolution; |
334 | if (!freq) | 342 | if (!freq) |