From 725e43d0c9a57d49b937c0b355d4b07fb9acc6b7 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 23 Jun 2011 12:41:33 -0300 Subject: [RHEL6 qemu-kvm PATCH 058/115] usb-linux: s/dprintf/DPRINTF/ to reduce conflicts RH-Author: Gerd Hoffmann Message-id: <1308832951-8995-58-git-send-email-kraxel@redhat.com> Patchwork-id: 28381 O-Subject: [RHEL-6.2 kvm PATCH 057/115] usb-linux: s/dprintf/DPRINTF/ to reduce conflicts Bugzilla: 561414 632299 645351 711354 RH-Acked-by: Hans de Goede RH-Acked-by: Jes Sorensen RH-Acked-by: Paolo Bonzini RH-Acked-by: Kevin Wolf RHEL6-only patch, to simplify backporting. Signed-off-by: Gerd Hoffmann --- usb-linux.c | 50 +++++++++++++++++++++++++------------------------- 1 files changed, 25 insertions(+), 25 deletions(-) Signed-off-by: Eduardo Habkost --- usb-linux.c | 50 +++++++++++++++++++++++++------------------------- 1 files changed, 25 insertions(+), 25 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index 174727d..03fc0df 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -69,9 +69,9 @@ typedef int USBScanFunc(void *opaque, int bus_num, int addr, int devpath, //#define DEBUG #ifdef DEBUG -#define dprintf printf +#define DPRINTF printf #else -#define dprintf(...) +#define DPRINTF(...) #endif #define USBDBG_DEVOPENED "husb: opened %s/devices\n" @@ -239,13 +239,13 @@ static void async_complete(void *opaque) return; } - dprintf("husb: async. reap urb failed errno %d\n", errno); + DPRINTF("husb: async. reap urb failed errno %d\n", errno); return; } p = aurb->packet; - dprintf("husb: async completed. aurb %p status %d alen %d\n", + DPRINTF("husb: async completed. aurb %p status %d alen %d\n", aurb, aurb->urb.status, aurb->urb.actual_length); if (p) { @@ -278,14 +278,14 @@ static void async_cancel(USBPacket *unused, void *opaque) AsyncURB *aurb = opaque; USBHostDevice *s = aurb->hdev; - dprintf("husb: async cancel. aurb %p\n", aurb); + DPRINTF("husb: async cancel. aurb %p\n", aurb); /* Mark it as dead (see async_complete above) */ aurb->packet = NULL; int r = ioctl(s->fd, USBDEVFS_DISCARDURB, aurb); if (r < 0) { - dprintf("husb: async. discard urb failed errno %d\n", errno); + DPRINTF("husb: async. discard urb failed errno %d\n", errno); } } @@ -298,7 +298,7 @@ static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration) if (configuration == 0) /* address state - ignore */ return 1; - dprintf("husb: claiming interfaces. config %d\n", configuration); + DPRINTF("husb: claiming interfaces. config %d\n", configuration); i = 0; dev_descr_len = dev->descr[0]; @@ -308,7 +308,7 @@ static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration) i += dev_descr_len; while (i < dev->descr_len) { - dprintf("husb: i is %d, descr_len is %d, dl %d, dt %d\n", i, dev->descr_len, + DPRINTF("husb: i is %d, descr_len is %d, dl %d, dt %d\n", i, dev->descr_len, dev->descr[i], dev->descr[i+1]); if (dev->descr[i+1] != USB_DT_CONFIG) { @@ -376,7 +376,7 @@ static int usb_host_release_interfaces(USBHostDevice *s) { int ret, i; - dprintf("husb: releasing interfaces\n"); + DPRINTF("husb: releasing interfaces\n"); for (i = 0; i < s->ninterfaces; i++) { ret = ioctl(s->fd, USBDEVFS_RELEASEINTERFACE, &i); @@ -393,7 +393,7 @@ static void usb_host_handle_reset(USBDevice *dev) { USBHostDevice *s = DO_UPCAST(USBHostDevice, dev, dev); - dprintf("husb: reset device %u.%u\n", s->bus_num, s->addr); + DPRINTF("husb: reset device %u.%u\n", s->bus_num, s->addr); ioctl(s->fd, USBDEVFS_RESET); @@ -431,7 +431,7 @@ static int usb_host_handle_data(USBHostDevice *s, USBPacket *p) if (is_halted(s, p->devep)) { ret = ioctl(s->fd, USBDEVFS_CLEAR_HALT, &urb->endpoint); if (ret < 0) { - dprintf("husb: failed to clear halt. ep 0x%x errno %d\n", + DPRINTF("husb: failed to clear halt. ep 0x%x errno %d\n", urb->endpoint, errno); return USB_RET_NAK; } @@ -456,10 +456,10 @@ static int usb_host_handle_data(USBHostDevice *s, USBPacket *p) ret = ioctl(s->fd, USBDEVFS_SUBMITURB, urb); - dprintf("husb: data submit. ep 0x%x len %u aurb %p\n", urb->endpoint, p->len, aurb); + DPRINTF("husb: data submit. ep 0x%x len %u aurb %p\n", urb->endpoint, p->len, aurb); if (ret < 0) { - dprintf("husb: submit failed. errno %d\n", errno); + DPRINTF("husb: submit failed. errno %d\n", errno); async_free(aurb); switch(errno) { @@ -485,7 +485,7 @@ static int ctrl_error(void) static int usb_host_set_address(USBHostDevice *s, int addr) { - dprintf("husb: ctrl set addr %u\n", addr); + DPRINTF("husb: ctrl set addr %u\n", addr); s->dev.addr = addr; return 0; } @@ -496,7 +496,7 @@ static int usb_host_set_config(USBHostDevice *s, int config) int ret = ioctl(s->fd, USBDEVFS_SETCONFIGURATION, &config); - dprintf("husb: ctrl set config %d ret %d errno %d\n", config, ret, errno); + DPRINTF("husb: ctrl set config %d ret %d errno %d\n", config, ret, errno); if (ret < 0) return ctrl_error(); @@ -514,7 +514,7 @@ static int usb_host_set_interface(USBHostDevice *s, int iface, int alt) si.altsetting = alt; ret = ioctl(s->fd, USBDEVFS_SETINTERFACE, &si); - dprintf("husb: ctrl set iface %d altset %d ret %d errno %d\n", + DPRINTF("husb: ctrl set iface %d altset %d ret %d errno %d\n", iface, alt, ret, errno); if (ret < 0) @@ -538,7 +538,7 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p) value = le16_to_cpu(s->ctrl.req.wValue); index = le16_to_cpu(s->ctrl.req.wIndex); - dprintf("husb: ctrl type 0x%x req 0x%x val 0x%x index %u len %u\n", + DPRINTF("husb: ctrl type 0x%x req 0x%x val 0x%x index %u len %u\n", s->ctrl.req.bRequestType, s->ctrl.req.bRequest, value, index, s->ctrl.len); @@ -587,10 +587,10 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p) ret = ioctl(s->fd, USBDEVFS_SUBMITURB, urb); - dprintf("husb: submit ctrl. len %u aurb %p\n", urb->buffer_length, aurb); + DPRINTF("husb: submit ctrl. len %u aurb %p\n", urb->buffer_length, aurb); if (ret < 0) { - dprintf("husb: submit failed. errno %d\n", errno); + DPRINTF("husb: submit failed. errno %d\n", errno); async_free(aurb); switch(errno) { @@ -865,7 +865,7 @@ static int usb_linux_update_endp_table(USBHostDevice *s) if (descriptors[i + 1] != USB_DT_CONFIG || descriptors[i + 5] != configuration) { - dprintf("invalid descriptor data - configuration\n"); + DPRINTF("invalid descriptor data - configuration\n"); return 1; } i += descriptors[i]; @@ -914,7 +914,7 @@ static int usb_linux_update_endp_table(USBHostDevice *s) type = USBDEVFS_URB_TYPE_INTERRUPT; break; default: - dprintf("usb_host: malformed endpoint type\n"); + DPRINTF("usb_host: malformed endpoint type\n"); type = USBDEVFS_URB_TYPE_BULK; } s->endp_table[(devep & 0xf) - 1].type = type; @@ -949,7 +949,7 @@ static int usb_host_open(USBHostDevice *dev, int bus_num, perror(buf); goto fail; } - dprintf("husb: opened %s\n", buf); + DPRINTF("husb: opened %s\n", buf); dev->bus_num = bus_num; dev->addr = addr; @@ -1390,7 +1390,7 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) strcpy(devpath, USBDEVBUS_PATH); usb_fs_type = USB_FS_SYS; closedir(dir); - dprintf(USBDBG_DEVOPENED, USBSYSBUS_PATH); + DPRINTF(USBDBG_DEVOPENED, USBSYSBUS_PATH); goto found_devices; } f = fopen(USBPROCBUS_PATH "/devices", "r"); @@ -1399,7 +1399,7 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) strcpy(devpath, USBPROCBUS_PATH); usb_fs_type = USB_FS_PROC; fclose(f); - dprintf(USBDBG_DEVOPENED, USBPROCBUS_PATH); + DPRINTF(USBDBG_DEVOPENED, USBPROCBUS_PATH); goto found_devices; } /* try additional methods if an access method hasn't been found yet */ @@ -1409,7 +1409,7 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) strcpy(devpath, USBDEVBUS_PATH); usb_fs_type = USB_FS_DEV; fclose(f); - dprintf(USBDBG_DEVOPENED, USBDEVBUS_PATH); + DPRINTF(USBDBG_DEVOPENED, USBDEVBUS_PATH); goto found_devices; } found_devices: -- 1.7.3.2