From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Khu32-0004NH-76 for qemu-devel@nongnu.org; Mon, 22 Sep 2008 18:38:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Khu30-0004N5-Lh for qemu-devel@nongnu.org; Mon, 22 Sep 2008 18:38:26 -0400 Received: from [199.232.76.173] (port=41820 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Khu30-0004N2-FY for qemu-devel@nongnu.org; Mon, 22 Sep 2008 18:38:26 -0400 Received: from ik-out-1112.google.com ([66.249.90.182]:44011) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Khu2z-0000FY-RL for qemu-devel@nongnu.org; Mon, 22 Sep 2008 18:38:26 -0400 Received: by ik-out-1112.google.com with SMTP id c21so1115686ika.2 for ; Mon, 22 Sep 2008 15:38:25 -0700 (PDT) Message-ID: <48D81E26.9080802@codemonkey.ws> Date: Mon, 22 Sep 2008 17:37:26 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1220571341.2638.6.camel@hephaestion> <1220580385.2638.15.camel@hephaestion> <48C1346F.3000405@windriver.com> <1220640699.5470.15.camel@hephaestion> <48C1862C.3050307@windriver.com> <1220649226.9611.13.camel@hephaestion> <48C53B04.9030006@windriver.com> <1221679892.17792.6.camel@hephaestion> <48D16904.30104@codemonkey.ws> <1221691647.17792.55.camel@hephaestion> In-Reply-To: <1221691647.17792.55.camel@hephaestion> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] Add USB sys file-system support (v5) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: TJ Cc: qemu-devel@nongnu.org, kvm TJ wrote: > Demoted to dprintf(). > > -------------------------------------- > This patch adds support for host USB devices discovered via: > > /sys/bus/usb/devices/* and opened from /dev/bus/usb/*/* > /dev/bus/usb/devices and opened from /dev/bus/usb/*/* > > in addition to the existing discovery via: > > /proc/bus/usb/devices and opened from /proc/bus/usb/*/* > > Signed-off-by: TJ > This patch is still white spaced damaged. > --- > --- a/usb-linux.c 2008-09-17 22:39:38.000000000 +0100 > +++ b/usb-linux.c 2008-09-17 23:42:32.000000000 +0100 > This chunk: > - if (fgets(line, sizeof(line), f) == NULL) > - break; > - if (strlen(line) > 0) > - line[strlen(line) - 1] = '\0'; > - if (line[0] == 'T' && line[1] == ':') { > - if (device_count && (vendor_id || product_id)) { > - /* New device. Add the previously discovered device. */ > - ret = func(opaque, bus_num, addr, class_id, vendor_id, > - product_id, product_name, speed); > - if (ret) > - goto the_end; > - } > - if (get_tag_value(buf, sizeof(buf), line, "Bus=", " ") < 0) > - goto fail; > - bus_num = atoi(buf); > - if (get_tag_value(buf, sizeof(buf), line, "Dev#=", " ") < 0) > - goto fail; > - addr = atoi(buf); > - if (get_tag_value(buf, sizeof(buf), line, "Spd=", " ") < 0) > - goto fail; > - if (!strcmp(buf, "480")) > - speed = USB_SPEED_HIGH; > - else if (!strcmp(buf, "1.5")) > - speed = USB_SPEED_LOW; > - else > - speed = USB_SPEED_FULL; > - product_name[0] = '\0'; > - class_id = 0xff; > - device_count++; > - product_id = 0; > - vendor_id = 0; > - } else if (line[0] == 'P' && line[1] == ':') { > - if (get_tag_value(buf, sizeof(buf), line, "Vendor=", " ") < 0) > - goto fail; > - vendor_id = strtoul(buf, NULL, 16); > - if (get_tag_value(buf, sizeof(buf), line, "ProdID=", " ") < 0) > - goto fail; > - product_id = strtoul(buf, NULL, 16); > - } else if (line[0] == 'S' && line[1] == ':') { > - if (get_tag_value(buf, sizeof(buf), line, "Product=", "") < 0) > - goto fail; > - pstrcpy(product_name, sizeof(product_name), buf); > - } else if (line[0] == 'D' && line[1] == ':') { > - if (get_tag_value(buf, sizeof(buf), line, "Cls=", " (") < 0) > - goto fail; > - class_id = strtoul(buf, NULL, 16); > - } > - fail: ; > Is identical to this chunk with the exception of whitespace. But curiously, not enough white space to warrant such a large diff. I broke out ediff-buffers to verify this. Did you reformat this whole region and then just query-replace the tabs with spaces? I can't see how diff would generate this chunk otherwise. There should be no changes here. I don't mean to be pedantic but it's extremely difficult to review a patch like this. > + if (fgets(line, sizeof(line), f) == NULL) > + break; > + if (strlen(line) > 0) > + line[strlen(line) - 1] = '\0'; > + if (line[0] == 'T' && line[1] == ':') { > + if (device_count && (vendor_id || product_id)) { > + /* New device. Add the previously discovered device. */ > + ret = func(opaque, bus_num, addr, class_id, vendor_id, > + product_id, product_name, speed); > + if (ret) > + goto the_end; > + } > + if (get_tag_value(buf, sizeof(buf), line, "Bus=", " ") < 0) > + goto fail; > + > + bus_num = atoi(buf); > + if (get_tag_value(buf, sizeof(buf), line, "Dev#=", " ") < 0) > + goto fail; > + > + addr = atoi(buf); > + if (get_tag_value(buf, sizeof(buf), line, "Spd=", " ") < 0) > + goto fail; > + > + if (!strcmp(buf, "480")) > + speed = USB_SPEED_HIGH; > + else if (!strcmp(buf, "1.5")) > + speed = USB_SPEED_LOW; > + else > + speed = USB_SPEED_FULL; > + product_name[0] = '\0'; > + class_id = 0xff; > + device_count++; > + product_id = 0; > + vendor_id = 0; > + } > + else if (line[0] == 'P' && line[1] == ':') { > + if (get_tag_value(buf, sizeof(buf), line, "Vendor=", " ") < 0) > + goto fail; > + > + vendor_id = strtoul(buf, NULL, 16); > + if (get_tag_value(buf, sizeof(buf), line, "ProdID=", " ") < 0) > + goto fail; > + > + product_id = strtoul(buf, NULL, 16); > + } > + else if (line[0] == 'S' && line[1] == ':') { > + if (get_tag_value(buf, sizeof(buf), line, "Product=", "") < 0) > + goto fail; > + > + pstrcpy(product_name, sizeof(product_name), buf); > + } > + else if (line[0] == 'D' && line[1] == ':') { > + if (get_tag_value(buf, sizeof(buf), line, "Cls=", " (") < 0) > + goto fail; > + > + class_id = strtoul(buf, NULL, 16); > + } > + fail: ; > } > if (device_count && (vendor_id || product_id)) { > - /* Add the last device. */ > - ret = func(opaque, bus_num, addr, class_id, vendor_id, > - product_id, product_name, speed); > Regards, Anthony Liguori