]> Git Repo - qemu.git/commitdiff
usb: remove fallback to bNumInterfaces if no .nif
authorBrad Hards <[email protected]>
Sun, 3 Apr 2011 05:33:20 +0000 (15:33 +1000)
committerGerd Hoffmann <[email protected]>
Thu, 26 May 2011 09:55:02 +0000 (11:55 +0200)
All callers have been updated.

Signed-off-by: Brad Hards <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
hw/usb-desc.c

index 62591f20aa45e323517fdf67cfd2c60f99834353..a784155dcf3f5e049e37fba2990d7ee23936faff 100644 (file)
@@ -76,7 +76,7 @@ int usb_desc_config(const USBDescConfig *conf, uint8_t *dest, size_t len)
 {
     uint8_t  bLength = 0x09;
     uint16_t wTotalLength = 0;
-    int i, rc, count;
+    int i, rc;
 
     if (len < bLength) {
         return -1;
@@ -91,8 +91,7 @@ int usb_desc_config(const USBDescConfig *conf, uint8_t *dest, size_t len)
     dest[0x08] = conf->bMaxPower;
     wTotalLength += bLength;
 
-    count = conf->nif ? conf->nif : conf->bNumInterfaces;
-    for (i = 0; i < count; i++) {
+    for (i = 0; i < conf->nif; i++) {
         rc = usb_desc_iface(conf->ifs + i, dest + wTotalLength, len - wTotalLength);
         if (rc < 0) {
             return rc;
This page took 0.024632 seconds and 4 git commands to generate.