From patchwork Sun Apr 3 05:33:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Hards X-Patchwork-Id: 89468 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E8170B6F44 for ; Sun, 3 Apr 2011 15:43:01 +1000 (EST) Received: from localhost ([127.0.0.1]:37446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6G5T-0001OF-8P for incoming@patchwork.ozlabs.org; Sun, 03 Apr 2011 01:42:59 -0400 Received: from [140.186.70.92] (port=39005 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6Fwe-0006Vu-CL for qemu-devel@nongnu.org; Sun, 03 Apr 2011 01:33:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6FwX-0005KX-8B for qemu-devel@nongnu.org; Sun, 03 Apr 2011 01:33:52 -0400 Received: from ipmail05.adl6.internode.on.net ([150.101.137.143]:49109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6FwW-0005IH-Ay for qemu-devel@nongnu.org; Sun, 03 Apr 2011 01:33:45 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiMHALMFmE2WZXPN/2dsb2JhbACYZI11wXYNghODSwQ Received: from ppp115-205.static.internode.on.net (HELO incana) ([150.101.115.205]) by ipmail05.adl6.internode.on.net with ESMTP; 03 Apr 2011 15:03:31 +0930 From: Brad Hards To: qemu-devel@nongnu.org Date: Sun, 3 Apr 2011 15:33:20 +1000 Message-Id: <1301808801-7850-4-git-send-email-bradh@frogmouth.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1301808801-7850-1-git-send-email-bradh@frogmouth.net> References: <1301808801-7850-1-git-send-email-bradh@frogmouth.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 150.101.137.143 Cc: kraxel@redhat.com, Brad Hards Subject: [Qemu-devel] [PATCH 3/4] usb: remove fallback to bNumInterfaces if no .nif X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org All callers have been updated. Signed-off-by: Brad Hards --- 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;