summaryrefslogtreecommitdiffstats
path: root/sound/core/seq/seq_midi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-11 09:16:54 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-11 09:16:54 -0700
commitd3570a5a7b8d0604fa012129f92637dc1534f62c (patch)
tree15d290595c363a2bdd4f4d6b3a2f7433e6e48f6d /sound/core/seq/seq_midi.c
parent37d9869ed928268409b48f52c57449918c0fd307 (diff)
parent72474be62d6ec2e0337ff01ecbd737f9c5c242c7 (diff)
Merge branch 'for-linus' of git://git.alsa-project.org/alsa-kernel
* 'for-linus' of git://git.alsa-project.org/alsa-kernel: (258 commits) ALSA: hda: VREF powerdown for headphones ALSA: hda: STAC_HP_M4 ALSA: ASoC: Check for machine type in GTA01 machine driver ALSA: mtpav - Fix race in probe ALSA: usb-audio: dynamic detection of MIDI interfaces in uaxx-quirk ALSA: Add a note on dependency of RTC stuff ALSA: ASoC: add new param mux to dapm_mux_update_power ALSA: Increase components array size ALSA: ASoC: Correct inverted Mic PGA Switch control in wm8510 driver ALSA: hda: comment typo fix ALSA: hda: comment typo fix ALSA: hda - Fix PCI SSID for ASROCK K18N78FullHD-hSLI ALSA: snd-usb-audio: support for Edirol UA-4FX device ALSA: usb - Fix possible Oops at USB-MIDI disconnection ALSA: hda - Fix another ALC889A (rev 0x100101) ALSA: hda: add more board-specific information for Realtek ALC662 rev1 ALSA: Correct Vladimir Barinov's e-mail address ALSA: cs46xx: Add PCI IDs for TerraTec and Hercules cards ALSA: hda: SPDIF stream muting support ALSA: hda: appletv support ...
Diffstat (limited to 'sound/core/seq/seq_midi.c')
-rw-r--r--sound/core/seq/seq_midi.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
index 99b35360c50..4d26146a62c 100644
--- a/sound/core/seq/seq_midi.c
+++ b/sound/core/seq/seq_midi.c
@@ -116,7 +116,8 @@ static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, i
struct snd_rawmidi_runtime *runtime;
int tmp;
- snd_assert(substream != NULL || buf != NULL, return -EINVAL);
+ if (snd_BUG_ON(!substream || !buf))
+ return -EINVAL;
runtime = substream->runtime;
if ((tmp = runtime->avail) < count) {
snd_printd("warning, output event was lost (count = %i, available = %i)\n", count, tmp);
@@ -135,7 +136,8 @@ static int event_process_midi(struct snd_seq_event *ev, int direct,
struct snd_rawmidi_substream *substream;
int len;
- snd_assert(msynth != NULL, return -EINVAL);
+ if (snd_BUG_ON(!msynth))
+ return -EINVAL;
substream = msynth->output_rfile.output;
if (substream == NULL)
return -ENODEV;
@@ -210,7 +212,8 @@ static int midisynth_unsubscribe(void *private_data, struct snd_seq_port_subscri
int err;
struct seq_midisynth *msynth = private_data;
- snd_assert(msynth->input_rfile.input != NULL, return -EINVAL);
+ if (snd_BUG_ON(!msynth->input_rfile.input))
+ return -EINVAL;
err = snd_rawmidi_kernel_release(&msynth->input_rfile);
return err;
}
@@ -247,7 +250,8 @@ static int midisynth_unuse(void *private_data, struct snd_seq_port_subscribe *in
struct seq_midisynth *msynth = private_data;
unsigned char buf = 0xff; /* MIDI reset */
- snd_assert(msynth->output_rfile.output != NULL, return -EINVAL);
+ if (snd_BUG_ON(!msynth->output_rfile.output))
+ return -EINVAL;
/* sending single MIDI reset message to shut the device up */
snd_rawmidi_kernel_write(msynth->output_rfile.output, &buf, 1);
snd_rawmidi_drain_output(msynth->output_rfile.output);
@@ -285,7 +289,8 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev)
int device = dev->device;
unsigned int input_count = 0, output_count = 0;
- snd_assert(card != NULL && device >= 0 && device < SNDRV_RAWMIDI_DEVICES, return -EINVAL);
+ if (snd_BUG_ON(!card || device < 0 || device >= SNDRV_RAWMIDI_DEVICES))
+ return -EINVAL;
info = kmalloc(sizeof(*info), GFP_KERNEL);
if (! info)
return -ENOMEM;