diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-08-01 14:38:18 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-08-01 22:54:35 +0200 |
commit | ef965ad5a7697ff16e3be01954f5c57208e36c22 (patch) | |
tree | 283dafc3f816b4e9b007976fda683e1f87682882 /include/sound | |
parent | ALSA: usb: Mark expected switch fall-through (diff) | |
download | linux-ef965ad5a7697ff16e3be01954f5c57208e36c22.tar.xz linux-ef965ad5a7697ff16e3be01954f5c57208e36c22.zip |
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 'include/sound')
-rw-r--r-- | include/sound/seq_midi_event.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/sound/seq_midi_event.h b/include/sound/seq_midi_event.h index e40f43e6fc7b..2f135bccf457 100644 --- a/include/sound/seq_midi_event.h +++ b/include/sound/seq_midi_event.h @@ -43,10 +43,8 @@ void snd_midi_event_free(struct snd_midi_event *dev); void snd_midi_event_reset_encode(struct snd_midi_event *dev); void snd_midi_event_reset_decode(struct snd_midi_event *dev); void snd_midi_event_no_status(struct snd_midi_event *dev, int on); -/* encode from byte stream - return number of written bytes if success */ -long snd_midi_event_encode(struct snd_midi_event *dev, unsigned char *buf, long count, - struct snd_seq_event *ev); -int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c, struct snd_seq_event *ev); +bool snd_midi_event_encode_byte(struct snd_midi_event *dev, unsigned char c, + struct snd_seq_event *ev); /* decode from event to bytes - return number of written bytes if success */ long snd_midi_event_decode(struct snd_midi_event *dev, unsigned char *buf, long count, struct snd_seq_event *ev); |