From: Brad Hards <bradh@frogmouth.net>
To: qemu-devel@nongnu.org
Cc: Brad Hards <bradh@frogmouth.net>
Subject: [Qemu-devel] [PATCH 3/4] usb: remove fallback to bNumInterfaces if no .nif
Date: Tue, 29 Mar 2011 13:31:34 +1100 [thread overview]
Message-ID: <1301365895-15056-4-git-send-email-bradh@frogmouth.net> (raw)
In-Reply-To: <1301365895-15056-1-git-send-email-bradh@frogmouth.net>
All callers have been updated.
---
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.0.4
next prev parent reply other threads:[~2011-03-29 2:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-29 2:31 [Qemu-devel] [PATCH 0/4] usb: implement Interface Association Descriptor support Brad Hards
2011-03-29 2:31 ` [Qemu-devel] [PATCH 1/4] usb: Add Interface Association Descriptor descriptor type Brad Hards
2011-03-29 2:31 ` [Qemu-devel] [PATCH 2/4] usb: update config descriptors to identify number of interfaces Brad Hards
2011-03-29 2:31 ` Brad Hards [this message]
2011-03-29 2:31 ` [Qemu-devel] [PATCH 4/4] usb: add support for "grouped" interfaces and the Interface Association Descriptor Brad Hards
-- strict thread matches above, loose matches on Subject: below --
2011-04-03 5:33 [Qemu-devel] [PATCH v2 0/4]usb: implement Interface Association Descriptor support Brad Hards
2011-04-03 5:33 ` [Qemu-devel] [PATCH 3/4] usb: remove fallback to bNumInterfaces if no .nif Brad Hards
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1301365895-15056-4-git-send-email-bradh@frogmouth.net \
--to=bradh@frogmouth.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).