All of lore.kernel.org
 help / color / mirror / Atom feed
From: matt mooney <mfm@muteddisk.com>
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 01/16] staging: usbip: stub_dev.c: coding style cleanup
Date: Fri,  6 May 2011 03:47:41 -0700	[thread overview]
Message-ID: <f8dae1ba6dc2fd17652689dc51f4210d803e51c2.1304676742.git.mfm@muteddisk.com> (raw)
In-Reply-To: <cover.1304676742.git.mfm@muteddisk.com>

Fix alignment for consistency and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
---
 drivers/staging/usbip/stub_dev.c |   44 ++++++++++---------------------------
 1 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c
index bce7d03..8a55068 100644
--- a/drivers/staging/usbip/stub_dev.c
+++ b/drivers/staging/usbip/stub_dev.c
@@ -23,13 +23,10 @@
 #include "usbip_common.h"
 #include "stub.h"
 
-
-
 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);
 
-
 /*
  * 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
@@ -64,7 +61,6 @@ struct usb_driver stub_driver = {
 	.id_table	= stub_table,
 };
 
-
 /*-------------------------------------------------------------------------*/
 
 /* Define sysfs entries for a usbip-bound device */
@@ -128,13 +124,11 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr,
 			spin_unlock(&sdev->ud.lock);
 			return -EINVAL;
 		}
-
 #if 0
 		setnodelay(socket);
 		setkeepalive(socket);
 		setreuse(socket);
 #endif
-
 		sdev->ud.tcp_socket = socket;
 
 		spin_unlock(&sdev->ud.lock);
@@ -183,10 +177,8 @@ static int stub_add_files(struct device *dev)
 
 err_debug:
 	device_remove_file(dev, &dev_attr_usbip_sockfd);
-
 err_sockfd:
 	device_remove_file(dev, &dev_attr_usbip_status);
-
 err_status:
 	return err;
 }
@@ -198,8 +190,6 @@ static void stub_remove_files(struct device *dev)
 	device_remove_file(dev, &dev_attr_usbip_debug);
 }
 
-
-
 /*-------------------------------------------------------------------------*/
 
 /* Event handler functions called by an event handler thread */
@@ -244,18 +234,15 @@ static void stub_shutdown_connection(struct usbip_device *ud)
 		struct stub_unlink *unlink, *tmp;
 
 		spin_lock_irqsave(&sdev->priv_lock, flags);
-
 		list_for_each_entry_safe(unlink, tmp, &sdev->unlink_tx, list) {
 			list_del(&unlink->list);
 			kfree(unlink);
 		}
-
 		list_for_each_entry_safe(unlink, tmp,
 						 &sdev->unlink_free, list) {
 			list_del(&unlink->list);
 			kfree(unlink);
 		}
-
 		spin_unlock_irqrestore(&sdev->priv_lock, flags);
 	}
 }
@@ -275,7 +262,6 @@ static void stub_device_reset(struct usbip_device *ud)
 		spin_lock(&ud->lock);
 		ud->status = SDEV_ST_ERROR;
 		spin_unlock(&ud->lock);
-
 		return;
 	}
 
@@ -306,7 +292,6 @@ static void stub_device_unusable(struct usbip_device *ud)
 	spin_unlock(&ud->lock);
 }
 
-
 /*-------------------------------------------------------------------------*/
 
 /**
@@ -339,13 +324,12 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev,
 	 * devnum may change later if a device is reset. However, devid never
 	 * changes during a usbip connection.
 	 */
-	sdev->devid     = (busnum << 16) | devnum;
-
-	sdev->ud.side = USBIP_STUB;
-	sdev->ud.status = SDEV_ST_AVAILABLE;
+	sdev->devid		= (busnum << 16) | devnum;
+	sdev->ud.side		= USBIP_STUB;
+	sdev->ud.status		= SDEV_ST_AVAILABLE;
 	/* sdev->ud.lock = SPIN_LOCK_UNLOCKED; */
 	spin_lock_init(&sdev->ud.lock);
-	sdev->ud.tcp_socket = NULL;
+	sdev->ud.tcp_socket	= NULL;
 
 	INIT_LIST_HEAD(&sdev->priv_init);
 	INIT_LIST_HEAD(&sdev->priv_tx);
@@ -378,7 +362,6 @@ static int stub_device_free(struct stub_device *sdev)
 	return 0;
 }
 
-
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -405,7 +388,7 @@ static int stub_probe(struct usb_interface *interface,
 	/* check we should claim or not by busid_table */
 	busid_priv = get_busid_priv(udev_busid);
 	if (!busid_priv  || (busid_priv->status == STUB_BUSID_REMOV) ||
-			     (busid_priv->status == STUB_BUSID_OTHER)) {
+	    (busid_priv->status == STUB_BUSID_OTHER)) {
 		dev_info(&interface->dev,
 			 "this device %s is not in match_busid table. skip!\n",
 			 udev_busid);
@@ -420,17 +403,16 @@ static int stub_probe(struct usb_interface *interface,
 
 	if (udev->descriptor.bDeviceClass ==  USB_CLASS_HUB) {
 		usbip_udbg("this device %s is a usb hub device. skip!\n",
-								udev_busid);
+			   udev_busid);
 		return -ENODEV;
 	}
 
 	if (!strcmp(udev->bus->bus_name, "vhci_hcd")) {
 		usbip_udbg("this device %s is attached on vhci_hcd. skip!\n",
-								udev_busid);
+			   udev_busid);
 		return -ENODEV;
 	}
 
-
 	if (busid_priv->status == STUB_BUSID_ALLOC) {
 		sdev = busid_priv->sdev;
 		if (!sdev)
@@ -438,9 +420,10 @@ static int stub_probe(struct usb_interface *interface,
 
 		busid_priv->interf_count++;
 		dev_info(&interface->dev,
-		 "USB/IP Stub: register a new interface "
-		 "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum,
-		 interface->cur_altsetting->desc.bInterfaceNumber);
+			 "USB/IP Stub: register a new interface "
+			 "(bus %u dev %u ifn %u)\n",
+			 udev->bus->busnum, udev->devnum,
+			 interface->cur_altsetting->desc.bInterfaceNumber);
 
 		/* set private data to usb_interface */
 		usb_set_intfdata(interface, sdev);
@@ -504,10 +487,8 @@ static void shutdown_busid(struct bus_id_priv *busid_priv)
 		/* 2. wait for the stop of the event handler */
 		usbip_stop_eh(&busid_priv->sdev->ud);
 	}
-
 }
 
-
 /*
  * called in usb_disconnect() or usb_deregister()
  * but only if actconfig(active configuration) exists
@@ -559,7 +540,6 @@ static void stub_disconnect(struct usb_interface *interface)
 
 	busid_priv->interf_count = 0;
 
-
 	/* 1. shutdown the current connection */
 	shutdown_busid(busid_priv);
 
-- 
1.7.5.1


WARNING: multiple messages have this Message-ID (diff)
From: matt mooney <mfm@muteddisk.com>
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 01/16] staging: usbip: stub_dev.c: coding style cleanup
Date: Fri, 06 May 2011 10:47:41 +0000	[thread overview]
Message-ID: <f8dae1ba6dc2fd17652689dc51f4210d803e51c2.1304676742.git.mfm@muteddisk.com> (raw)
In-Reply-To: <cover.1304676742.git.mfm@muteddisk.com>

Fix alignment for consistency and remove extraneous lines.

Signed-off-by: matt mooney <mfm@muteddisk.com>
---
 drivers/staging/usbip/stub_dev.c |   44 ++++++++++---------------------------
 1 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c
index bce7d03..8a55068 100644
--- a/drivers/staging/usbip/stub_dev.c
+++ b/drivers/staging/usbip/stub_dev.c
@@ -23,13 +23,10 @@
 #include "usbip_common.h"
 #include "stub.h"
 
-
-
 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);
 
-
 /*
  * 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
@@ -64,7 +61,6 @@ struct usb_driver stub_driver = {
 	.id_table	= stub_table,
 };
 
-
 /*-------------------------------------------------------------------------*/
 
 /* Define sysfs entries for a usbip-bound device */
@@ -128,13 +124,11 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr,
 			spin_unlock(&sdev->ud.lock);
 			return -EINVAL;
 		}
-
 #if 0
 		setnodelay(socket);
 		setkeepalive(socket);
 		setreuse(socket);
 #endif
-
 		sdev->ud.tcp_socket = socket;
 
 		spin_unlock(&sdev->ud.lock);
@@ -183,10 +177,8 @@ static int stub_add_files(struct device *dev)
 
 err_debug:
 	device_remove_file(dev, &dev_attr_usbip_sockfd);
-
 err_sockfd:
 	device_remove_file(dev, &dev_attr_usbip_status);
-
 err_status:
 	return err;
 }
@@ -198,8 +190,6 @@ static void stub_remove_files(struct device *dev)
 	device_remove_file(dev, &dev_attr_usbip_debug);
 }
 
-
-
 /*-------------------------------------------------------------------------*/
 
 /* Event handler functions called by an event handler thread */
@@ -244,18 +234,15 @@ static void stub_shutdown_connection(struct usbip_device *ud)
 		struct stub_unlink *unlink, *tmp;
 
 		spin_lock_irqsave(&sdev->priv_lock, flags);
-
 		list_for_each_entry_safe(unlink, tmp, &sdev->unlink_tx, list) {
 			list_del(&unlink->list);
 			kfree(unlink);
 		}
-
 		list_for_each_entry_safe(unlink, tmp,
 						 &sdev->unlink_free, list) {
 			list_del(&unlink->list);
 			kfree(unlink);
 		}
-
 		spin_unlock_irqrestore(&sdev->priv_lock, flags);
 	}
 }
@@ -275,7 +262,6 @@ static void stub_device_reset(struct usbip_device *ud)
 		spin_lock(&ud->lock);
 		ud->status = SDEV_ST_ERROR;
 		spin_unlock(&ud->lock);
-
 		return;
 	}
 
@@ -306,7 +292,6 @@ static void stub_device_unusable(struct usbip_device *ud)
 	spin_unlock(&ud->lock);
 }
 
-
 /*-------------------------------------------------------------------------*/
 
 /**
@@ -339,13 +324,12 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev,
 	 * devnum may change later if a device is reset. However, devid never
 	 * changes during a usbip connection.
 	 */
-	sdev->devid     = (busnum << 16) | devnum;
-
-	sdev->ud.side = USBIP_STUB;
-	sdev->ud.status = SDEV_ST_AVAILABLE;
+	sdev->devid		= (busnum << 16) | devnum;
+	sdev->ud.side		= USBIP_STUB;
+	sdev->ud.status		= SDEV_ST_AVAILABLE;
 	/* sdev->ud.lock = SPIN_LOCK_UNLOCKED; */
 	spin_lock_init(&sdev->ud.lock);
-	sdev->ud.tcp_socket = NULL;
+	sdev->ud.tcp_socket	= NULL;
 
 	INIT_LIST_HEAD(&sdev->priv_init);
 	INIT_LIST_HEAD(&sdev->priv_tx);
@@ -378,7 +362,6 @@ static int stub_device_free(struct stub_device *sdev)
 	return 0;
 }
 
-
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -405,7 +388,7 @@ static int stub_probe(struct usb_interface *interface,
 	/* check we should claim or not by busid_table */
 	busid_priv = get_busid_priv(udev_busid);
 	if (!busid_priv  || (busid_priv->status = STUB_BUSID_REMOV) ||
-			     (busid_priv->status = STUB_BUSID_OTHER)) {
+	    (busid_priv->status = STUB_BUSID_OTHER)) {
 		dev_info(&interface->dev,
 			 "this device %s is not in match_busid table. skip!\n",
 			 udev_busid);
@@ -420,17 +403,16 @@ static int stub_probe(struct usb_interface *interface,
 
 	if (udev->descriptor.bDeviceClass =  USB_CLASS_HUB) {
 		usbip_udbg("this device %s is a usb hub device. skip!\n",
-								udev_busid);
+			   udev_busid);
 		return -ENODEV;
 	}
 
 	if (!strcmp(udev->bus->bus_name, "vhci_hcd")) {
 		usbip_udbg("this device %s is attached on vhci_hcd. skip!\n",
-								udev_busid);
+			   udev_busid);
 		return -ENODEV;
 	}
 
-
 	if (busid_priv->status = STUB_BUSID_ALLOC) {
 		sdev = busid_priv->sdev;
 		if (!sdev)
@@ -438,9 +420,10 @@ static int stub_probe(struct usb_interface *interface,
 
 		busid_priv->interf_count++;
 		dev_info(&interface->dev,
-		 "USB/IP Stub: register a new interface "
-		 "(bus %u dev %u ifn %u)\n", udev->bus->busnum, udev->devnum,
-		 interface->cur_altsetting->desc.bInterfaceNumber);
+			 "USB/IP Stub: register a new interface "
+			 "(bus %u dev %u ifn %u)\n",
+			 udev->bus->busnum, udev->devnum,
+			 interface->cur_altsetting->desc.bInterfaceNumber);
 
 		/* set private data to usb_interface */
 		usb_set_intfdata(interface, sdev);
@@ -504,10 +487,8 @@ static void shutdown_busid(struct bus_id_priv *busid_priv)
 		/* 2. wait for the stop of the event handler */
 		usbip_stop_eh(&busid_priv->sdev->ud);
 	}
-
 }
 
-
 /*
  * called in usb_disconnect() or usb_deregister()
  * but only if actconfig(active configuration) exists
@@ -559,7 +540,6 @@ static void stub_disconnect(struct usb_interface *interface)
 
 	busid_priv->interf_count = 0;
 
-
 	/* 1. shutdown the current connection */
 	shutdown_busid(busid_priv);
 
-- 
1.7.5.1


  reply	other threads:[~2011-05-06 10:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06 10:47 [PATCH 00/16] staging: usbip: cleanup matt mooney
2011-05-06 10:47 ` matt mooney
2011-05-06 10:47 ` matt mooney [this message]
2011-05-06 10:47   ` [PATCH 01/16] staging: usbip: stub_dev.c: coding style cleanup matt mooney
2011-05-06 10:47 ` [PATCH 02/16] staging: usbip: stub_main.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 03/16] staging: usbip: stub_rx.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 04/16] staging: usbip: stub_tx.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 05/16] staging: usbip: usbip_common.h: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 06/16] staging: usbip: usbip_common.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 07/16] staging: usbip: usbip_event.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 08/16] staging: usbip: stub.h: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 09/16] staging: usbip: vhci.h: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 10/16] staging: usbip: vhci_hcd.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 11/16] staging: usbip: vhci_rx.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 12/16] staging: usbip: vhci_sysfs.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 13/16] staging: usbip: vhci_tx.c: " matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 14/16] staging: usbip: add break to default case in switch statements matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 15/16] staging: usbip: remove section dividers matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 10:47 ` [PATCH 16/16] staging: usbip: fixup MODULE_ macros matt mooney
2011-05-06 10:47   ` matt mooney
2011-05-06 21:27 ` [PATCH 00/16] staging: usbip: cleanup Greg KH
2011-05-06 21:27   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8dae1ba6dc2fd17652689dc51f4210d803e51c2.1304676742.git.mfm@muteddisk.com \
    --to=mfm@muteddisk.com \
    --cc=greg@kroah.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.