summaryrefslogtreecommitdiff
path: root/sound/core/seq/oss/seq_oss_midi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-08-01 14:38:18 +0200
committerTakashi Iwai <tiwai@suse.de>2018-08-01 22:54:35 +0200
commitef965ad5a7697ff16e3be01954f5c57208e36c22 (patch)
tree283dafc3f816b4e9b007976fda683e1f87682882 /sound/core/seq/oss/seq_oss_midi.c
parentd5e77fca87e636dda510710689b4c2ca93765598 (diff)
ALSA: seq: Minor cleanup of MIDI event parser helpers
snd_midi_event_encode_byte() can never fail, and it can return rather true/false. Change the return type to bool, adjust the argument to receive a MIDI byte as unsigned char, and adjust the comment accordingly. This allows callers to drop error checks, which simplifies the code. Meanwhile, snd_midi_event_encode() helper is used only in seq_midi.c, and it can be better folded into it. This will reduce the total amount of lines in the end. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq/oss/seq_oss_midi.c')
-rw-r--r--sound/core/seq/oss/seq_oss_midi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c
index 9debd1b8fd28..0d5f8b16d057 100644
--- a/sound/core/seq/oss/seq_oss_midi.c
+++ b/sound/core/seq/oss/seq_oss_midi.c
@@ -637,7 +637,7 @@ snd_seq_oss_midi_putc(struct seq_oss_devinfo *dp, int dev, unsigned char c, stru
if ((mdev = get_mididev(dp, dev)) == NULL)
return -ENODEV;
- if (snd_midi_event_encode_byte(mdev->coder, c, ev) > 0) {
+ if (snd_midi_event_encode_byte(mdev->coder, c, ev)) {
snd_seq_oss_fill_addr(dp, ev, mdev->client, mdev->port);
snd_use_lock_free(&mdev->use_lock);
return 0;