[PATCH 6/6] staging: usbip: Minor cleanups.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clean up some debug messages and comments.

Signed-off-by: Bernard Blackham <b-linuxgit@xxxxxxxxxxxxxxxx>
---
 drivers/staging/usbip/usbip_event.c |    2 +-
 drivers/staging/usbip/vhci_hcd.c    |   23 ++++++++++-------------
 drivers/staging/usbip/vhci_rx.c     |   12 ++++++------
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
index d332a34..be94143 100644
--- a/drivers/staging/usbip/usbip_event.c
+++ b/drivers/staging/usbip/usbip_event.c
@@ -53,7 +53,7 @@ static int event_handler(struct usbip_device *ud)
 			ud->event &= ~USBIP_EH_UNUSABLE;
 		}
 
-		/* Stop the error handler. */
+		/* Stop the event handler. */
 		if (ud->event & USBIP_EH_BYE)
 			return -1;
 	}
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index bb54fc5..6568f1f 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -219,8 +219,6 @@ static int vhci_hub_status(struct usb_hcd *hcd, char *buf)
 		}
 	}
 
-	pr_info("changed %d\n", changed);
-
 	if (hcd->state == HC_STATE_SUSPENDED)
 		usb_hcd_resume_root_hub(hcd);
 
@@ -659,7 +657,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 	int ret = 0;
 	int giveback = 0;
 
-	pr_info("dequeue a urb %p\n", urb);
+	pr_debug("dequeue a urb %p\n", urb);
 
 	priv = urb->hcpriv;
 	if (!priv) {
@@ -680,8 +678,8 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 
 	if (!vdev->ud.tcp_socket) {
 		/* tcp connection is closed */
+		pr_debug("device %p seems to be disconnected\n", vdev);
 
-		pr_info("device %p seems to be disconnected\n", vdev);
 		spin_lock(&vdev->priv_lock);
 		list_del(&priv->list);
 		spin_unlock(&vdev->priv_lock);
@@ -694,7 +692,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 		 * vhci_rx will receive RET_UNLINK and give back the URB.
 		 * Otherwise, we give back it here.
 		 */
-		pr_info("gives back urb %p\n", urb);
+		pr_debug("gives back urb %p\n", urb);
 
 		usb_hcd_unlink_urb_from_ep(hcd, urb);
 
@@ -714,11 +712,11 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 
 		unlink->seqnum = atomic_inc_return(&the_controller->seqnum);
 		if (unlink->seqnum == 0xffff)
-			pr_info("seqnum max\n");
+			pr_debug("seqnum max\n");
 
-		unlink->unlink_seqnum = priv->seqnum;
+		pr_debug("device %p seems to be still connected\n", vdev);
 
-		pr_info("device %p seems to be still connected\n", vdev);
+		unlink->unlink_seqnum = priv->seqnum;
 
 		spin_lock(&vdev->priv_lock);
 
@@ -763,12 +761,11 @@ static void vhci_device_unlink_cleanup(struct vhci_device *vdev)
 		}
 
 		/* give back URB of unanswered unlink request */
-		pr_info("unlink cleanup rx %lu\n", unlink->unlink_seqnum);
 		list_del(&unlink->list);
 
 		urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum);
 		if (!urb) {
-			pr_info("the urb (seqnum %lu) was already given back\n",
+			pr_debug("the urb (seqnum %lu) was already given back\n",
 				unlink->unlink_seqnum);
 			kfree(unlink);
 			continue;
@@ -814,14 +811,14 @@ static void vhci_shutdown_connection(struct usbip_device *ud)
 	if (vdev->ud.tcp_tx)
 		kthread_stop_put(vdev->ud.tcp_tx);
 
-	pr_info("stop threads\n");
+	pr_debug("stop threads\n");
 
 	/* active connection is closed */
 	if (vdev->ud.tcp_socket) {
 		fput(vdev->ud.tcp_socket->file);
 		vdev->ud.tcp_socket = NULL;
 	}
-	pr_info("release socket\n");
+	pr_debug("release socket\n");
 
 	vhci_device_unlink_cleanup(vdev);
 
@@ -847,7 +844,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud)
 	 */
 	rh_port_disconnect(vdev->rhport);
 
-	pr_info("disconnect device\n");
+	pr_debug("disconnect device\n");
 }
 
 
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c
index ec91306..85f7580 100644
--- a/drivers/staging/usbip/vhci_rx.c
+++ b/drivers/staging/usbip/vhci_rx.c
@@ -75,7 +75,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,
 
 	if (!urb) {
 		pr_err("cannot find a urb of seqnum %u\n", pdu->base.seqnum);
-		pr_info("max seqnum %d\n",
+		pr_debug("max seqnum %d\n",
 			atomic_read(&the_controller->seqnum));
 		usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
 		return;
@@ -86,11 +86,11 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,
 
 	/* recv transfer buffer */
 	if (usbip_recv_xbuff(ud, urb) < 0)
-		return;
+		return; /* XXX: unlink/giveback? */
 
 	/* recv iso_packet_descriptor */
 	if (usbip_recv_iso(ud, urb) < 0)
-		return;
+		return; /* XXX: unlink/giveback? */
 
 	/* restore the padding in iso packets */
 	usbip_pad_iso(ud, urb);
@@ -120,7 +120,7 @@ static struct vhci_unlink *dequeue_pending_unlink(struct vhci_device *vdev,
 	spin_lock_irq(&vdev->priv_lock);
 
 	list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) {
-		pr_info("unlink->seqnum %lu\n", unlink->seqnum);
+		pr_debug("unlink->seqnum %lu\n", unlink->seqnum);
 		if (unlink->seqnum == pdu->base.seqnum) {
 			usbip_dbg_vhci_rx("found pending unlink, %lu\n",
 					  unlink->seqnum);
@@ -160,14 +160,14 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev,
 		 * already received the result of its submit result and gave
 		 * back the URB.
 		 */
-		pr_info("the urb (seqnum %d) was already given back\n",
+		pr_debug("the urb (seqnum %d) was already given back\n",
 			pdu->base.seqnum);
 	} else {
 		usbip_dbg_vhci_rx("now giveback urb %p\n", urb);
 
 		/* If unlink is succeed, status is -ECONNRESET */
 		urb->status = pdu->u.ret_unlink.status;
-		pr_info("urb->status %d\n", urb->status);
+		pr_debug("urb->status %d\n", urb->status);
 
 		spin_lock_irq(&the_controller->lock);
 		usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux