diff options
author | Marc Balmer <mbalmer@cvs.openbsd.org> | 2007-06-18 11:53:12 +0000 |
---|---|---|
committer | Marc Balmer <mbalmer@cvs.openbsd.org> | 2007-06-18 11:53:12 +0000 |
commit | e69a48929183e05f9432477cc36d541d1f3c4c7a (patch) | |
tree | 8615a87ea4c3aed5a44954c450fa61d496da49c8 | |
parent | feca006814806ef9c95ea9c82ca6153c7592f43b (diff) |
KNF after macro removals, no binary change.
ok dlg.
-rw-r--r-- | sys/dev/usb/usbdi_util.c | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/sys/dev/usb/usbdi_util.c b/sys/dev/usb/usbdi_util.c index e84f447e1de..aca1df8e013 100644 --- a/sys/dev/usb/usbdi_util.c +++ b/sys/dev/usb/usbdi_util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi_util.c,v 1.23 2007/06/12 16:26:37 mbalmer Exp $ */ +/* $OpenBSD: usbdi_util.c,v 1.24 2007/06/18 11:53:11 mbalmer Exp $ */ /* $NetBSD: usbdi_util.c,v 1.40 2002/07/11 21:14:36 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi_util.c,v 1.14 1999/11/17 22:33:50 n_hibma Exp $ */ @@ -66,8 +66,8 @@ usbd_get_desc(usbd_device_handle dev, int type, int index, int len, void *desc) { usb_device_request_t req; - DPRINTFN(3,("usbd_get_desc: type=%d, index=%d, len=%d\n", - type, index, len)); + DPRINTFN(3,("usbd_get_desc: type=%d, index=%d, len=%d\n", type, index, + len)); req.bmRequestType = UT_READ_DEVICE; req.bRequest = UR_GET_DESCRIPTOR; @@ -79,19 +79,19 @@ usbd_get_desc(usbd_device_handle dev, int type, int index, int len, void *desc) usbd_status usbd_get_config_desc(usbd_device_handle dev, int confidx, - usb_config_descriptor_t *d) + usb_config_descriptor_t *d) { usbd_status err; DPRINTFN(3,("usbd_get_config_desc: confidx=%d\n", confidx)); err = usbd_get_desc(dev, UDESC_CONFIG, confidx, - USB_CONFIG_DESCRIPTOR_SIZE, d); + USB_CONFIG_DESCRIPTOR_SIZE, d); if (err) return (err); if (d->bDescriptorType != UDESC_CONFIG) { DPRINTFN(-1,("usbd_get_config_desc: confidx=%d, bad desc " - "len=%d type=%d\n", - confidx, d->bLength, d->bDescriptorType)); + "len=%d type=%d\n", confidx, d->bLength, + d->bDescriptorType)); return (USBD_INVAL); } return (USBD_NORMAL_COMPLETION); @@ -108,8 +108,8 @@ usbd_status usbd_get_device_desc(usbd_device_handle dev, usb_device_descriptor_t *d) { DPRINTFN(3,("usbd_get_device_desc:\n")); - return (usbd_get_desc(dev, UDESC_DEVICE, - 0, USB_DEVICE_DESCRIPTOR_SIZE, d)); + return (usbd_get_desc(dev, UDESC_DEVICE, 0, USB_DEVICE_DESCRIPTOR_SIZE, + d)); } usbd_status @@ -223,8 +223,8 @@ usbd_get_protocol(usbd_interface_handle iface, u_int8_t *report) usbd_device_handle dev; usb_device_request_t req; - DPRINTFN(4, ("usbd_get_protocol: iface=%p, endpt=%d\n", - iface, id->bInterfaceNumber)); + DPRINTFN(4, ("usbd_get_protocol: iface=%p, endpt=%d\n", iface, + id->bInterfaceNumber)); if (id == NULL) return (USBD_IOERROR); usbd_interface2device_handle(iface, &dev); @@ -244,7 +244,7 @@ usbd_set_protocol(usbd_interface_handle iface, int report) usb_device_request_t req; DPRINTFN(4, ("usbd_set_protocol: iface=%p, report=%d, endpt=%d\n", - iface, report, id->bInterfaceNumber)); + iface, report, id->bInterfaceNumber)); if (id == NULL) return (USBD_IOERROR); usbd_interface2device_handle(iface, &dev); @@ -258,7 +258,7 @@ usbd_set_protocol(usbd_interface_handle iface, int report) usbd_status usbd_set_report(usbd_interface_handle iface, int type, int id, void *data, - int len) + int len) { usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface); usbd_device_handle dev; @@ -278,7 +278,7 @@ usbd_set_report(usbd_interface_handle iface, int type, int id, void *data, usbd_status usbd_set_report_async(usbd_interface_handle iface, int type, int id, - void *data, int len) + void *data, int len) { usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface); usbd_device_handle dev; @@ -298,7 +298,7 @@ usbd_set_report_async(usbd_interface_handle iface, int type, int id, usbd_status usbd_get_report(usbd_interface_handle iface, int type, int id, void *data, - int len) + int len) { usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface); usbd_device_handle dev; @@ -336,8 +336,8 @@ usbd_set_idle(usbd_interface_handle iface, int duration, int id) } usbd_status -usbd_get_report_descriptor(usbd_device_handle dev, int ifcno, - int size, void *d) +usbd_get_report_descriptor(usbd_device_handle dev, int ifcno, int size, + void *d) { usb_device_request_t req; @@ -378,7 +378,7 @@ usbd_get_hid_descriptor(usbd_interface_handle ifc) usbd_status usbd_read_report_desc(usbd_interface_handle ifc, void **descp, int *sizep, - int mem) + int mem) { usb_interface_descriptor_t *id; usb_hid_descriptor_t *hid; @@ -396,8 +396,8 @@ usbd_read_report_desc(usbd_interface_handle ifc, void **descp, int *sizep, *descp = malloc(*sizep, mem, M_NOWAIT); if (*descp == NULL) return (USBD_NOMEM); - err = usbd_get_report_descriptor(dev, id->bInterfaceNumber, - *sizep, *descp); + err = usbd_get_report_descriptor(dev, id->bInterfaceNumber, *sizep, + *descp); if (err) { free(*descp, mem); *descp = NULL; @@ -419,25 +419,24 @@ usbd_get_config(usbd_device_handle dev, u_int8_t *conf) return (usbd_do_request(dev, &req, conf)); } -void usbd_bulk_transfer_cb(usbd_xfer_handle xfer, - usbd_private_handle priv, usbd_status status); +void usbd_bulk_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv, + usbd_status status); void usbd_bulk_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv, - usbd_status status) + usbd_status status) { wakeup(xfer); } usbd_status usbd_bulk_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe, - u_int16_t flags, u_int32_t timeout, void *buf, - u_int32_t *size, char *lbl) + u_int16_t flags, u_int32_t timeout, void *buf, u_int32_t *size, char *lbl) { usbd_status err; int s, error; - usbd_setup_xfer(xfer, pipe, 0, buf, *size, - flags, timeout, usbd_bulk_transfer_cb); + usbd_setup_xfer(xfer, pipe, 0, buf, *size, flags, timeout, + usbd_bulk_transfer_cb); DPRINTFN(1, ("usbd_bulk_transfer: start transfer %d bytes\n", *size)); s = splusb(); /* don't want callback until tsleep() */ err = usbd_transfer(xfer); @@ -461,25 +460,24 @@ usbd_bulk_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe, return (err); } -void usbd_intr_transfer_cb(usbd_xfer_handle xfer, - usbd_private_handle priv, usbd_status status); +void usbd_intr_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv, + usbd_status status); void usbd_intr_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv, - usbd_status status) + usbd_status status) { wakeup(xfer); } usbd_status usbd_intr_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe, - u_int16_t flags, u_int32_t timeout, void *buf, - u_int32_t *size, char *lbl) + u_int16_t flags, u_int32_t timeout, void *buf, u_int32_t *size, char *lbl) { usbd_status err; int s, error; - usbd_setup_xfer(xfer, pipe, 0, buf, *size, - flags, timeout, usbd_intr_transfer_cb); + usbd_setup_xfer(xfer, pipe, 0, buf, *size, flags, timeout, + usbd_intr_transfer_cb); DPRINTFN(1, ("usbd_intr_transfer: start transfer %d bytes\n", *size)); s = splusb(); /* don't want callback until tsleep() */ err = usbd_transfer(xfer); @@ -508,8 +506,7 @@ usb_detach_wait(struct device *dv) { DPRINTF(("usb_detach_wait: waiting for %s\n", dv->dv_xname)); if (tsleep(dv, PZERO, "usbdet", hz * 60)) - printf("usb_detach_wait: %s didn't detach\n", - dv->dv_xname); + printf("usb_detach_wait: %s didn't detach\n", dv->dv_xname); DPRINTF(("usb_detach_wait: %s done\n", dv->dv_xname)); } |