From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QORg6-0001Sq-EI for qemu-devel@nongnu.org; Mon, 23 May 2011 05:43:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QORg4-0007jL-B9 for qemu-devel@nongnu.org; Mon, 23 May 2011 05:43:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QORg4-0007j6-3p for qemu-devel@nongnu.org; Mon, 23 May 2011 05:43:56 -0400 From: Gerd Hoffmann Date: Mon, 23 May 2011 11:43:24 +0200 Message-Id: <1306143819-30287-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1306143819-30287-1-git-send-email-kraxel@redhat.com> References: <1306143819-30287-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 03/18] usb: remove fallback to bNumInterfaces if no .nif List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Brad Hards From: Brad Hards All callers have been updated. Signed-off-by: Brad Hards Signed-off-by: Gerd Hoffmann --- hw/usb-desc.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/usb-desc.c b/hw/usb-desc.c index 62591f2..a784155 100644 --- a/hw/usb-desc.c +++ b/hw/usb-desc.c @@ -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; -- 1.7.1