diff options
author | Stefan Reif <ke42caxa@cip.cs.fau.de> | 2013-04-04 16:03:04 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-05 14:22:50 -0700 |
commit | 2663d79b8393460dc8ba9cafe0bf8eaeacbd0bf6 (patch) | |
tree | d9b95aaa9ffb13005435f3eb39f03b6f12d76a27 /drivers/staging/usbip | |
parent | c5a73ee2d1eb3f1961e6af0590971669d87deac8 (diff) |
staging: usbip: reformat function pickup_urb_and_free_priv
re-indent funtion "pickup_urb_and_free_priv" to improve readability.
Signed-off-by: Stefan Reif <ke42caxa@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r-- | drivers/staging/usbip/vhci_rx.c | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c index faf8e607c5c6..50d6fd5bb70d 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c @@ -31,33 +31,37 @@ struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, __u32 seqnum) int status; list_for_each_entry_safe(priv, tmp, &vdev->priv_rx, list) { - if (priv->seqnum == seqnum) { - urb = priv->urb; - status = urb->status; - - usbip_dbg_vhci_rx("find urb %p vurb %p seqnum %u\n", - urb, priv, seqnum); - - /* TODO: fix logic here to improve indent situtation */ - if (status != -EINPROGRESS) { - if (status == -ENOENT || - status == -ECONNRESET) - dev_info(&urb->dev->dev, - "urb %p was unlinked " - "%ssynchronuously.\n", urb, - status == -ENOENT ? "" : "a"); - else - dev_info(&urb->dev->dev, - "urb %p may be in a error, " - "status %d\n", urb, status); - } - - list_del(&priv->list); - kfree(priv); - urb->hcpriv = NULL; - + if (priv->seqnum != seqnum) + continue; + + urb = priv->urb; + status = urb->status; + + usbip_dbg_vhci_rx("find urb %p vurb %p seqnum %u\n", + urb, priv, seqnum); + + switch (status) { + case -ENOENT: + /* fall through */ + case -ECONNRESET: + dev_info(&urb->dev->dev, + "urb %p was unlinked %ssynchronuously.\n", urb, + status == -ENOENT ? "" : "a"); + break; + case -EINPROGRESS: + /* no info output */ break; + default: + dev_info(&urb->dev->dev, + "urb %p may be in a error, status %d\n", urb, + status); } + + list_del(&priv->list); + kfree(priv); + urb->hcpriv = NULL; + + break; } return urb; |