uas: Streams are numbered 1-y, rather then 0-x

It is easier to simply make the arrays one larger, rather then
substracting one everywhere.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Hans de Goede 2013-10-24 18:15:52 +01:00 committed by Gerd Hoffmann
parent 5eb6d9e3ef
commit 0478661ec5

View File

@ -122,8 +122,8 @@ struct UASDevice {
UASRequest *dataout2;
/* usb 3.0 only */
USBPacket *data3[UAS_MAX_STREAMS];
USBPacket *status3[UAS_MAX_STREAMS];
USBPacket *data3[UAS_MAX_STREAMS + 1];
USBPacket *status3[UAS_MAX_STREAMS + 1];
};
struct UASRequest {
@ -666,7 +666,7 @@ static void usb_uas_cancel_io(USBDevice *dev, USBPacket *p)
return;
}
if (uas_using_streams(uas)) {
for (i = 0; i < UAS_MAX_STREAMS; i++) {
for (i = 0; i <= UAS_MAX_STREAMS; i++) {
if (uas->status3[i] == p) {
uas->status3[i] = NULL;
return;