Commit bd608f6c authored by matt mooney's avatar matt mooney Committed by Greg Kroah-Hartman

staging: usbip: vhci_sysfs.c: coding style cleanup

Fix a few alignment issues and remove extraneous lines.
Add braces to else clause.
Signed-off-by: default avatarmatt mooney <mfm@muteddisk.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5ef6aceb
...@@ -52,20 +52,19 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr, ...@@ -52,20 +52,19 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr,
struct vhci_device *vdev = port_to_vdev(i); struct vhci_device *vdev = port_to_vdev(i);
spin_lock(&vdev->ud.lock); spin_lock(&vdev->ud.lock);
out += sprintf(out, "%03u %03u ", i, vdev->ud.status); out += sprintf(out, "%03u %03u ", i, vdev->ud.status);
if (vdev->ud.status == VDEV_ST_USED) { if (vdev->ud.status == VDEV_ST_USED) {
out += sprintf(out, "%03u %08x ", out += sprintf(out, "%03u %08x ",
vdev->speed, vdev->devid); vdev->speed, vdev->devid);
out += sprintf(out, "%16p ", vdev->ud.tcp_socket); out += sprintf(out, "%16p ", vdev->ud.tcp_socket);
out += sprintf(out, "%s", dev_name(&vdev->udev->dev)); out += sprintf(out, "%s", dev_name(&vdev->udev->dev));
} else } else {
out += sprintf(out, "000 000 000 0000000000000000 0-0"); out += sprintf(out, "000 000 000 0000000000000000 0-0");
}
out += sprintf(out, "\n"); out += sprintf(out, "\n");
spin_unlock(&vdev->ud.lock); spin_unlock(&vdev->ud.lock);
} }
...@@ -126,6 +125,7 @@ static ssize_t store_detach(struct device *dev, struct device_attribute *attr, ...@@ -126,6 +125,7 @@ static ssize_t store_detach(struct device *dev, struct device_attribute *attr,
return -EINVAL; return -EINVAL;
usbip_dbg_vhci_sysfs("Leave\n"); usbip_dbg_vhci_sysfs("Leave\n");
return count; return count;
} }
static DEVICE_ATTR(detach, S_IWUSR, NULL, store_detach); static DEVICE_ATTR(detach, S_IWUSR, NULL, store_detach);
...@@ -182,8 +182,7 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr, ...@@ -182,8 +182,7 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
sscanf(buf, "%u %u %u %u", &rhport, &sockfd, &devid, &speed); sscanf(buf, "%u %u %u %u", &rhport, &sockfd, &devid, &speed);
usbip_dbg_vhci_sysfs("rhport(%u) sockfd(%u) devid(%u) speed(%u)\n", usbip_dbg_vhci_sysfs("rhport(%u) sockfd(%u) devid(%u) speed(%u)\n",
rhport, sockfd, devid, speed); rhport, sockfd, devid, speed);
/* check received parameters */ /* check received parameters */
if (valid_args(rhport, speed) < 0) if (valid_args(rhport, speed) < 0)
...@@ -198,9 +197,7 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr, ...@@ -198,9 +197,7 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
/* begin a lock */ /* begin a lock */
spin_lock(&the_controller->lock); spin_lock(&the_controller->lock);
vdev = port_to_vdev(rhport); vdev = port_to_vdev(rhport);
spin_lock(&vdev->ud.lock); spin_lock(&vdev->ud.lock);
if (vdev->ud.status != VDEV_ST_NULL) { if (vdev->ud.status != VDEV_ST_NULL) {
...@@ -213,7 +210,7 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr, ...@@ -213,7 +210,7 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
} }
usbip_uinfo("rhport(%u) sockfd(%d) devid(%u) speed(%u)\n", usbip_uinfo("rhport(%u) sockfd(%d) devid(%u) speed(%u)\n",
rhport, sockfd, devid, speed); rhport, sockfd, devid, speed);
vdev->devid = devid; vdev->devid = devid;
vdev->speed = speed; vdev->speed = speed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment