Skip to content

Commit

Permalink
ALSA: ump: Drop redundant check of note-on with zero velocity
Browse files Browse the repository at this point in the history
The check of a note-on event with zero velocity is done twice, and the
latter one is superfluous.  Let's drop it.

Fixes: 0b5288f ("ALSA: ump: Add legacy raw MIDI support")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/4683198a-84f6-4238-9e87-c70667d84523@kili.mountain
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20230525083124.15277-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed May 25, 2023
1 parent dafb82e commit ab2335d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions sound/core/ump_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ static int cvt_legacy_cmd_to_ump(struct snd_ump_endpoint *ump,

switch (status) {
case UMP_MSG_STATUS_NOTE_ON:
if (!buf[2])
status = UMP_MSG_STATUS_NOTE_OFF;
fallthrough;
case UMP_MSG_STATUS_NOTE_OFF:
midi2->note.note = buf[1];
midi2->note.velocity = upscale_7_to_16bit(buf[2]);
Expand Down

0 comments on commit ab2335d

Please sign in to comment.