svn commit: r189173 - head/sys/dev/usb
Andrew Thompson
thompsa at FreeBSD.org
Sat Feb 28 09:20:03 PST 2009
Author: thompsa
Date: Sat Feb 28 17:20:00 2009
New Revision: 189173
URL: http://svn.freebsd.org/changeset/base/189173
Log:
A couple of style nits in the last commit
- unwrap short lines
- move variable initialisation out of the declaration.
Modified:
head/sys/dev/usb/usb_dev.c
head/sys/dev/usb/usb_device.c
Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c Sat Feb 28 17:14:03 2009 (r189172)
+++ head/sys/dev/usb/usb_dev.c Sat Feb 28 17:20:00 2009 (r189173)
@@ -473,8 +473,7 @@ usb2_fifo_create(struct usb2_cdev_privda
/* Check TX FIFO */
if (is_tx &&
(udev->fifo[n + USB_FIFO_TX] == NULL)) {
- pipe = usb2_dev_get_pipe(udev,
- ep, USB_FIFO_TX);
+ pipe = usb2_dev_get_pipe(udev, ep, USB_FIFO_TX);
DPRINTFN(5, "dev_get_pipe(%d, 0x%x)\n", ep, USB_FIFO_TX);
if (pipe == NULL) {
DPRINTFN(5, "dev_get_pipe returned NULL\n");
@@ -501,8 +500,7 @@ usb2_fifo_create(struct usb2_cdev_privda
if (is_rx &&
(udev->fifo[n + USB_FIFO_RX] == NULL)) {
- pipe = usb2_dev_get_pipe(udev,
- ep, USB_FIFO_RX);
+ pipe = usb2_dev_get_pipe(udev, ep, USB_FIFO_RX);
DPRINTFN(5, "dev_get_pipe(%d, 0x%x)\n", ep, USB_FIFO_RX);
if (pipe == NULL) {
DPRINTFN(5, "dev_get_pipe returned NULL\n");
@@ -598,8 +596,7 @@ usb2_fifo_free(struct usb2_fifo *f)
}
static struct usb2_pipe *
-usb2_dev_get_pipe(struct usb2_device *udev,
- uint8_t ep_index, uint8_t dir)
+usb2_dev_get_pipe(struct usb2_device *udev, uint8_t ep_index, uint8_t dir)
{
struct usb2_pipe *pipe;
uint8_t ep_dir;
Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c Sat Feb 28 17:14:03 2009 (r189172)
+++ head/sys/dev/usb/usb_device.c Sat Feb 28 17:20:00 2009 (r189173)
@@ -1722,8 +1722,7 @@ usb2_make_dev(struct usb2_device *udev,
/* Now, create the device itself */
snprintf(devname, sizeof(devname), "%u.%u.%u",
- pd->bus_index, pd->dev_index,
- pd->ep_addr);
+ pd->bus_index, pd->dev_index, pd->ep_addr);
pd->cdev = make_dev(&usb2_devsw, 0, UID_ROOT,
GID_OPERATOR, 0600, USB_DEVICE_DIR "/%s", devname);
pd->cdev->si_drv1 = pd;
@@ -1734,7 +1733,7 @@ usb2_make_dev(struct usb2_device *udev,
static void
usb2_cdev_create(struct usb2_device *udev)
{
- struct usb2_config_descriptor *cd = usb2_get_config_descriptor(udev);
+ struct usb2_config_descriptor *cd;
struct usb2_endpoint_descriptor *ed;
struct usb2_descriptor *desc;
struct usb2_fs_privdata* pd;
@@ -1762,6 +1761,7 @@ usb2_cdev_create(struct usb2_device *ude
* Collect all used endpoint numbers instead of just
* generating 16 static endpoints.
*/
+ cd = usb2_get_config_descriptor(udev);
while ((desc = usb2_desc_foreach(cd, desc))) {
/* filter out all endpoint descriptors */
if ((desc->bDescriptorType == UDESC_ENDPOINT) &&
More information about the svn-src-all
mailing list