diff options
Diffstat (limited to 'drivers/staging/line6/midibuf.c')
-rw-r--r-- | drivers/staging/line6/midibuf.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/staging/line6/midibuf.c b/drivers/staging/line6/midibuf.c index f0adb7baa603..1ff856989fd6 100644 --- a/drivers/staging/line6/midibuf.c +++ b/drivers/staging/line6/midibuf.c @@ -15,11 +15,14 @@ static int midibuf_message_length(unsigned char code) { + int message_length; + if (code < 0x80) - return -1; + message_length = -1; else if (code < 0xf0) { static const int length[] = { 3, 3, 3, 3, 2, 2, 3 }; - return length[(code >> 4) - 8]; + + message_length = length[(code >> 4) - 8]; } else { /* Note that according to the MIDI specification 0xf2 is @@ -29,8 +32,10 @@ static int midibuf_message_length(unsigned char code) static const int length[] = { -1, 2, -1, 2, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1 }; - return length[code & 0x0f]; + message_length = length[code & 0x0f]; } + + return message_length; } static int midibuf_is_empty(struct midi_buffer *this) |