[alsa-devel] [PATCH v2 7/9] ALSA: line6: Allow processing of raw incoming messages

Andrej Kruták dev at andree.sk
Tue Aug 30 16:35:16 CEST 2016


>> -     for (;;) {
>> -             done =
>> -                 line6_midibuf_read(mb, line6->buffer_message,
>> -                                    LINE6_MESSAGE_MAXLEN);
>> +             for (;;) {
>> +                     done =
>> +                             line6_midibuf_read(mb, line6->buffer_message,
>> +                                             LINE6_MESSAGE_MAXLEN);
>>
>> -             if (done == 0)
>> -                     break;
>> +                     if (done == 0)
>> +                             break;
>>
>> -             line6->message_length = done;
>> -             line6_midi_receive(line6, line6->buffer_message, done);
>> +                     line6->message_length = done;
>> +                     line6_midi_receive(line6, line6->buffer_message, done);
>>
>> +                     if (line6->process_message)
>> +                             line6->process_message(line6);
>> +             }
>> +     } else {
>>               if (line6->process_message)
>>                       line6->process_message(line6);
>>       }
>
> Both if and else run the same code (line6->process_message) here at
> the end.  That is, this can be outside the if block.
>

Nope, the first one is done in a loop...

> Also, the patch should be also before the actual usage, i.e. patch 5.
>

Ack.


-- 
Andrej


More information about the Alsa-devel mailing list