From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9zYn-0003Io-27 for qemu-devel@nongnu.org; Wed, 13 Apr 2011 08:52:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9zYe-0001Ky-C5 for qemu-devel@nongnu.org; Wed, 13 Apr 2011 08:52:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9zYe-0001KN-0u for qemu-devel@nongnu.org; Wed, 13 Apr 2011 08:52:32 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3DCqTHZ008613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Apr 2011 08:52:30 -0400 Received: from shalem.localdomain (vpn1-5-68.ams2.redhat.com [10.36.5.68]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3DCqRR1032634 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 13 Apr 2011 08:52:29 -0400 Message-ID: <4DA59C95.1020904@redhat.com> Date: Wed, 13 Apr 2011 14:52:37 +0200 From: Hans de Goede MIME-Version: 1.0 References: <1302687934-1287-1-git-send-email-bradh@frogmouth.net> <1302687934-1287-5-git-send-email-bradh@frogmouth.net> In-Reply-To: <1302687934-1287-5-git-send-email-bradh@frogmouth.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/4] usb: use DPRINTF instead of printf for some simple cases List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, On 04/13/2011 11:45 AM, Brad Hards wrote: > Signed-off-by: Brad Hards > --- > usb-linux.c | 16 ++++++++-------- > 1 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/usb-linux.c b/usb-linux.c > index 1f33c2c..b02a0f9 100644 > --- a/usb-linux.c > +++ b/usb-linux.c > @@ -233,8 +233,8 @@ static void async_complete(void *opaque) > return; > } > if (errno == ENODEV&& !s->closing) { > - printf("husb: device %d.%d disconnected\n", > - s->bus_num, s->addr); > + DPRINTF("husb: device %d.%d disconnected\n", > + s->bus_num, s->addr); > usb_host_close(s); > usb_host_auto_check(NULL); > return; I think this one should stay a regular printf, in case the disconnect is unintentional people may think it is a qemu problem without the printf. > @@ -320,7 +320,7 @@ static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration) > } > config_descr_len = dev->descr[i]; > > - printf("husb: config #%d need %d\n", dev->descr[i + 5], configuration); > + DPRINTF("husb: config #%d need %d\n", dev->descr[i + 5], configuration); > > if (configuration< 0 || configuration == dev->descr[i + 5]) { > configuration = dev->descr[i + 5]; Ack. > @@ -359,7 +359,7 @@ static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration) > ret = ioctl(dev->fd, USBDEVFS_CLAIMINTERFACE,&interface); > if (ret< 0) { > if (errno == EBUSY) { > - printf("husb: update iface. device already grabbed\n"); > + DPRINTF("husb: update iface. device already grabbed\n"); > } else { > perror("husb: failed to claim interface"); > } Nack, this is an error condition, so it should not be a DPRINTF. > @@ -368,8 +368,8 @@ static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration) > } > } > > - printf("husb: %d interfaces claimed for configuration %d\n", > - nb_interfaces, configuration); > + DPRINTF("husb: %d interfaces claimed for configuration %d\n", > + nb_interfaces, configuration); > > dev->ninterfaces = nb_interfaces; > dev->configuration = configuration; Ack. > @@ -929,7 +929,7 @@ static int usb_host_open(USBHostDevice *dev, int bus_num, > if (dev->fd != -1) { > goto fail; > } > - printf("husb: open device %d.%d\n", bus_num, addr); > + DPRINTF("husb: open device %d.%d\n", bus_num, addr); > > if (!usb_host_device_path) { > perror("husb: USB Host Device Path not set"); Ack. > @@ -984,7 +984,7 @@ static int usb_host_open(USBHostDevice *dev, int bus_num, > goto fail; > } > > - printf("husb: grabbed usb device %d.%d\n", bus_num, addr); > + DPRINTF("husb: grabbed usb device %d.%d\n", bus_num, addr); > > ret = usb_linux_update_endp_table(dev); > if (ret) { Ack.