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

staging: usbip: stub_dev.c: coding style cleanup

Fix alignment for consistency and remove extraneous lines.
Signed-off-by: default avatarmatt mooney <mfm@muteddisk.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e8591270
...@@ -23,13 +23,10 @@ ...@@ -23,13 +23,10 @@
#include "usbip_common.h" #include "usbip_common.h"
#include "stub.h" #include "stub.h"
static int stub_probe(struct usb_interface *interface, static int stub_probe(struct usb_interface *interface,
const struct usb_device_id *id); const struct usb_device_id *id);
static void stub_disconnect(struct usb_interface *interface); static void stub_disconnect(struct usb_interface *interface);
/* /*
* Define device IDs here if you want to explicitly limit exportable devices. * Define device IDs here if you want to explicitly limit exportable devices.
* In the most cases, wild card matching will be ok because driver binding can * In the most cases, wild card matching will be ok because driver binding can
...@@ -64,7 +61,6 @@ struct usb_driver stub_driver = { ...@@ -64,7 +61,6 @@ struct usb_driver stub_driver = {
.id_table = stub_table, .id_table = stub_table,
}; };
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* Define sysfs entries for a usbip-bound device */ /* Define sysfs entries for a usbip-bound device */
...@@ -128,13 +124,11 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr, ...@@ -128,13 +124,11 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr,
spin_unlock(&sdev->ud.lock); spin_unlock(&sdev->ud.lock);
return -EINVAL; return -EINVAL;
} }
#if 0 #if 0
setnodelay(socket); setnodelay(socket);
setkeepalive(socket); setkeepalive(socket);
setreuse(socket); setreuse(socket);
#endif #endif
sdev->ud.tcp_socket = socket; sdev->ud.tcp_socket = socket;
spin_unlock(&sdev->ud.lock); spin_unlock(&sdev->ud.lock);
...@@ -183,10 +177,8 @@ static int stub_add_files(struct device *dev) ...@@ -183,10 +177,8 @@ static int stub_add_files(struct device *dev)
err_debug: err_debug:
device_remove_file(dev, &dev_attr_usbip_sockfd); device_remove_file(dev, &dev_attr_usbip_sockfd);
err_sockfd: err_sockfd:
device_remove_file(dev, &dev_attr_usbip_status); device_remove_file(dev, &dev_attr_usbip_status);
err_status: err_status:
return err; return err;
} }
...@@ -198,8 +190,6 @@ static void stub_remove_files(struct device *dev) ...@@ -198,8 +190,6 @@ static void stub_remove_files(struct device *dev)
device_remove_file(dev, &dev_attr_usbip_debug); device_remove_file(dev, &dev_attr_usbip_debug);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* Event handler functions called by an event handler thread */ /* Event handler functions called by an event handler thread */
...@@ -244,18 +234,15 @@ static void stub_shutdown_connection(struct usbip_device *ud) ...@@ -244,18 +234,15 @@ static void stub_shutdown_connection(struct usbip_device *ud)
struct stub_unlink *unlink, *tmp; struct stub_unlink *unlink, *tmp;
spin_lock_irqsave(&sdev->priv_lock, flags); spin_lock_irqsave(&sdev->priv_lock, flags);
list_for_each_entry_safe(unlink, tmp, &sdev->unlink_tx, list) { list_for_each_entry_safe(unlink, tmp, &sdev->unlink_tx, list) {
list_del(&unlink->list); list_del(&unlink->list);
kfree(unlink); kfree(unlink);
} }
list_for_each_entry_safe(unlink, tmp, list_for_each_entry_safe(unlink, tmp,
&sdev->unlink_free, list) { &sdev->unlink_free, list) {
list_del(&unlink->list); list_del(&unlink->list);
kfree(unlink); kfree(unlink);
} }
spin_unlock_irqrestore(&sdev->priv_lock, flags); spin_unlock_irqrestore(&sdev->priv_lock, flags);
} }
} }
...@@ -275,7 +262,6 @@ static void stub_device_reset(struct usbip_device *ud) ...@@ -275,7 +262,6 @@ static void stub_device_reset(struct usbip_device *ud)
spin_lock(&ud->lock); spin_lock(&ud->lock);
ud->status = SDEV_ST_ERROR; ud->status = SDEV_ST_ERROR;
spin_unlock(&ud->lock); spin_unlock(&ud->lock);
return; return;
} }
...@@ -306,7 +292,6 @@ static void stub_device_unusable(struct usbip_device *ud) ...@@ -306,7 +292,6 @@ static void stub_device_unusable(struct usbip_device *ud)
spin_unlock(&ud->lock); spin_unlock(&ud->lock);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/** /**
...@@ -340,7 +325,6 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev, ...@@ -340,7 +325,6 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev,
* changes during a usbip connection. * changes during a usbip connection.
*/ */
sdev->devid = (busnum << 16) | devnum; sdev->devid = (busnum << 16) | devnum;
sdev->ud.side = USBIP_STUB; sdev->ud.side = USBIP_STUB;
sdev->ud.status = SDEV_ST_AVAILABLE; sdev->ud.status = SDEV_ST_AVAILABLE;
/* sdev->ud.lock = SPIN_LOCK_UNLOCKED; */ /* sdev->ud.lock = SPIN_LOCK_UNLOCKED; */
...@@ -378,7 +362,6 @@ static int stub_device_free(struct stub_device *sdev) ...@@ -378,7 +362,6 @@ static int stub_device_free(struct stub_device *sdev)
return 0; return 0;
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* /*
...@@ -430,7 +413,6 @@ static int stub_probe(struct usb_interface *interface, ...@@ -430,7 +413,6 @@ static int stub_probe(struct usb_interface *interface,
return -ENODEV; return -ENODEV;
} }
if (busid_priv->status == STUB_BUSID_ALLOC) { if (busid_priv->status == STUB_BUSID_ALLOC) {
sdev = busid_priv->sdev; sdev = busid_priv->sdev;
if (!sdev) if (!sdev)
...@@ -439,7 +421,8 @@ static int stub_probe(struct usb_interface *interface, ...@@ -439,7 +421,8 @@ static int stub_probe(struct usb_interface *interface,
busid_priv->interf_count++; busid_priv->interf_count++;
dev_info(&interface->dev, dev_info(&interface->dev,
"USB/IP Stub: register a new interface " "USB/IP Stub: register a new interface "
"(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum, "(bus %u dev %u ifn %u)\n",
udev->bus->busnum, udev->devnum,
interface->cur_altsetting->desc.bInterfaceNumber); interface->cur_altsetting->desc.bInterfaceNumber);
/* set private data to usb_interface */ /* set private data to usb_interface */
...@@ -504,10 +487,8 @@ static void shutdown_busid(struct bus_id_priv *busid_priv) ...@@ -504,10 +487,8 @@ static void shutdown_busid(struct bus_id_priv *busid_priv)
/* 2. wait for the stop of the event handler */ /* 2. wait for the stop of the event handler */
usbip_stop_eh(&busid_priv->sdev->ud); usbip_stop_eh(&busid_priv->sdev->ud);
} }
} }
/* /*
* called in usb_disconnect() or usb_deregister() * called in usb_disconnect() or usb_deregister()
* but only if actconfig(active configuration) exists * but only if actconfig(active configuration) exists
...@@ -559,7 +540,6 @@ static void stub_disconnect(struct usb_interface *interface) ...@@ -559,7 +540,6 @@ static void stub_disconnect(struct usb_interface *interface)
busid_priv->interf_count = 0; busid_priv->interf_count = 0;
/* 1. shutdown the current connection */ /* 1. shutdown the current connection */
shutdown_busid(busid_priv); shutdown_busid(busid_priv);
......
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