]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/echoaudio/midi.c
ALSA: Kill snd_assert() in sound/pci/*
[linux-2.6-omap-h63xx.git] / sound / pci / echoaudio / midi.c
index 91f5bff66d3f923fa870184bfc3705be62b1f7a9..77bf2a83d9970751c3e26a449c7dfa1d882f89d8 100644 (file)
@@ -59,7 +59,8 @@ static int enable_midi_input(struct echoaudio *chip, char enable)
 Returns how many actually written or < 0 on error */
 static int write_midi(struct echoaudio *chip, u8 *data, int bytes)
 {
-       snd_assert(bytes > 0 && bytes < MIDI_OUT_BUFFER_SIZE, return -EINVAL);
+       if (snd_BUG_ON(bytes <= 0 || bytes >= MIDI_OUT_BUFFER_SIZE))
+               return -EINVAL;
 
        if (wait_handshake(chip))
                return -EIO;
@@ -119,7 +120,8 @@ static int midi_service_irq(struct echoaudio *chip)
        /* The count is at index 0, followed by actual data */
        count = le16_to_cpu(chip->comm_page->midi_input[0]);
 
-       snd_assert(count < MIDI_IN_BUFFER_SIZE, return 0);
+       if (snd_BUG_ON(count >= MIDI_IN_BUFFER_SIZE))
+               return 0;
 
        /* Get the MIDI data from the comm page */
        i = 1;