Commit 6cbd4aa9 authored by Jose A. Lopez's avatar Jose A. Lopez Committed by Greg Kroah-Hartman

[PATCH] usbmidi patch

I have changed the name of a local variable "l" to be "j", because with some
fonts should be difficult to see if [1+l+i] means [2+i] or what.
parent 90cc0e1a
...@@ -368,7 +368,7 @@ static void usb_bulk_read(struct urb *urb) ...@@ -368,7 +368,7 @@ static void usb_bulk_read(struct urb *urb)
{ {
struct midi_in_endpoint *ep = (struct midi_in_endpoint *)(urb->context); struct midi_in_endpoint *ep = (struct midi_in_endpoint *)(urb->context);
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
int i, l, wake; int i, j, wake;
unsigned long int flags; unsigned long int flags;
if ( !ep->urbSubmitted ) { if ( !ep->urbSubmitted ) {
...@@ -379,14 +379,14 @@ static void usb_bulk_read(struct urb *urb) ...@@ -379,14 +379,14 @@ static void usb_bulk_read(struct urb *urb)
wake = 0; wake = 0;
spin_lock_irqsave( &ep->lock, flags ); spin_lock_irqsave( &ep->lock, flags );
for(l = 0; l < urb->actual_length; l += 4) { for(j = 0; j < urb->actual_length; j += 4) {
int cin = (data[l]>>0)&0xf; int cin = (data[j]>>0)&0xf;
int cab = (data[l]>>4)&0xf; int cab = (data[j]>>4)&0xf;
struct usb_mididev *cable = ep->cables[cab]; struct usb_mididev *cable = ep->cables[cab];
if ( cable ) { if ( cable ) {
int len = cin_to_len[cin]; /** length of MIDI data **/ int len = cin_to_len[cin]; /** length of MIDI data **/
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
cable->min.buf[cable->min.bufWrPtr] = data[1+i]; cable->min.buf[cable->min.bufWrPtr] = data[1+i+j];
cable->min.bufWrPtr = (cable->min.bufWrPtr+1)%MIDI_IN_BUFSIZ; cable->min.bufWrPtr = (cable->min.bufWrPtr+1)%MIDI_IN_BUFSIZ;
if (cable->min.bufRemains < MIDI_IN_BUFSIZ) if (cable->min.bufRemains < MIDI_IN_BUFSIZ)
cable->min.bufRemains += 1; cable->min.bufRemains += 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment