diff options
-rw-r--r-- | lib/libusb/usb-core.c | 4 | ||||
-rw-r--r-- | lib/libusb/usb-ehci.c | 3 | ||||
-rw-r--r-- | lib/libusb/usb-hid.c | 2 | ||||
-rw-r--r-- | lib/libusb/usb-ohci.c | 12 | ||||
-rw-r--r-- | lib/libusb/usb-xhci.c | 17 |
5 files changed, 19 insertions, 19 deletions
diff --git a/lib/libusb/usb-core.c b/lib/libusb/usb-core.c index 4c720ce..6ad8028 100644 --- a/lib/libusb/usb-core.c +++ b/lib/libusb/usb-core.c @@ -18,7 +18,7 @@ #ifdef DEBUG #define dprintf(_x ...) do { printf(_x); } while(0) #else -#define dprintf(_x ...) +#define dprintf(_x ...) do {} while (0) #endif #define __unused __attribute__((unused)) @@ -386,7 +386,7 @@ int usb_hid_exit(void *vdev) int usb_msc_init(void *vdev) { struct usb_dev *dev; - int i; + unsigned i; dev = (struct usb_dev *) vdev; dprintf("%s: enter %x\n", __func__, dev->class); diff --git a/lib/libusb/usb-ehci.c b/lib/libusb/usb-ehci.c index 60af9e1..4b1b0a8 100644 --- a/lib/libusb/usb-ehci.c +++ b/lib/libusb/usb-ehci.c @@ -22,7 +22,8 @@ #ifdef EHCI_DEBUG #define dprintf(_x ...) do { printf(_x); } while(0) #else -#define dprintf(_x ...) +#define dprintf(_x ...) do {} while (0) + #endif #ifdef EHCI_DEBUG diff --git a/lib/libusb/usb-hid.c b/lib/libusb/usb-hid.c index 1ea9ff2..ce87d21 100644 --- a/lib/libusb/usb-hid.c +++ b/lib/libusb/usb-hid.c @@ -390,7 +390,7 @@ uint32_t *kbd_buffer; int usb_hid_kbd_init(struct usb_dev *dev) { - int i; + unsigned i; uint8_t key[8]; usb_hid_set_protocol(dev, 0); diff --git a/lib/libusb/usb-ohci.c b/lib/libusb/usb-ohci.c index d06c754..3f2ecf3 100644 --- a/lib/libusb/usb-ohci.c +++ b/lib/libusb/usb-ohci.c @@ -21,7 +21,7 @@ #ifdef OHCI_DEBUG #define dprintf(_x ...) do { printf(_x); } while(0) #else -#define dprintf(_x ...) +#define dprintf(_x ...) do {} while (0) #endif #undef OHCI_DEBUG_PACKET @@ -29,7 +29,7 @@ #ifdef OHCI_DEBUG_PACKET #define dpprintf(_x ...) do { printf(_x); } while(0) #else -#define dpprintf(_x ...) +#define dpprintf(_x ...) do {} while (0) #endif @@ -199,10 +199,7 @@ static void ohci_hub_check_ports(struct ohci_hcd *ohcd) } if (port_status & RH_PS_PESC) { port_clear |= RH_PS_PESC; - if (port_status & RH_PS_PES) - dprintf("enabled\n"); - else - dprintf("disabled\n"); + dprintf((port_status & RH_PS_PES) ? "enabled\n" : "disabled\n"); } if (port_status & RH_PS_PSSC) { port_clear |= RH_PS_PESC; @@ -927,9 +924,10 @@ static struct usb_pipe *ohci_get_pipe(struct usb_dev *dev, struct usb_ep_descr * new->epno = ep->bEndpointAddress & 0xF; new->dir = ep->bEndpointAddress & 0x80; if (new->type == USB_EP_TYPE_INTR) - if (!ohci_get_pipe_intr(new, ohcd, buf, buflen)) + if (!ohci_get_pipe_intr(new, ohcd, buf, buflen)) { dprintf("usb-ohci: %s alloc_intr failed %p\n", __func__, new); + } if (new->type == USB_EP_TYPE_BULK) ohci_init_bulk_ed(dev, new); diff --git a/lib/libusb/usb-xhci.c b/lib/libusb/usb-xhci.c index 3ce6c00..cdf8042 100644 --- a/lib/libusb/usb-xhci.c +++ b/lib/libusb/usb-xhci.c @@ -22,7 +22,7 @@ #ifdef XHCI_DEBUG #define dprintf(_x ...) do { printf("%s: ", __func__); printf(_x); } while (0) #else -#define dprintf(_x ...) +#define dprintf(_x ...) do {} while (0) #endif struct port_state ps_array_usb2[] = { @@ -42,9 +42,9 @@ struct port_state ps_array_usb3[] = { {1, 1, 1, 0, PORTSC_PLS_U0, "****** Enabled ******"}, }; +#ifdef XHCI_DEBUG static void dump_xhci_regs(struct xhci_hcd *xhcd) { -#ifdef XHCI_DEBUG struct xhci_cap_regs *cap; struct xhci_op_regs *op; struct xhci_run_regs *run; @@ -75,12 +75,10 @@ static void dump_xhci_regs(struct xhci_hcd *xhcd) dprintf(" - MFINDEX %08X\n", read_reg32(&run->mfindex)); dprintf("\n"); -#endif } static void print_port_status(struct xhci_port_regs *prs) { -#ifdef XHCI_DEBUG uint32_t portsc; uint32_t CCS, PED, PP, PLS, i, PR = 0; @@ -152,10 +150,13 @@ static void print_port_status(struct xhci_port_regs *prs) } } } -#endif - } +#else +#define dump_xhci_regs(r) do {} while (0) +#define print_port_status(prs) do {} while (0) +#endif + static inline bool xhci_is_hc_ready(uint32_t *usbsts) { return !(read_reg32(usbsts) & XHCI_USBSTS_CNR); @@ -1157,7 +1158,7 @@ static inline struct xhci_seg *xhci_pipe_get_seg(struct usb_pipe *pipe) static inline void *xhci_get_trb(struct xhci_seg *seg) { uint64_t val, enq; - int index; + unsigned index; struct xhci_link_trb *link; enq = val = seg->enq; @@ -1185,7 +1186,7 @@ static inline void *xhci_get_trb(struct xhci_seg *seg) static inline void *xhci_get_trb_deq(struct xhci_seg *seg) { uint64_t deq_next, deq; - int index; + unsigned index; deq = seg->deq; deq_next = deq + XHCI_TRB_SIZE; |