diff options
author | Joe Perches <joe@perches.com> | 2013-02-11 17:41:29 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-11 18:10:33 (GMT) |
commit | 78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b (patch) | |
tree | 6534f66eb765163602ad1af98c651bea6ae09416 /drivers/staging/usbip/vhci_hcd.c | |
parent | ad463ac42771a0bb8a706cf8a985788fe5f5c1c6 (diff) | |
download | linux-fsl-qoriq-78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b.tar.xz |
staging: Remove unnecessary OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.
For the affected mallocs around these OOM messages:
Converted kzallocs with multiplies to kcalloc.
Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/strlen/strncpy to kstrdup.
Moved a spin_lock below a removed OOM message and
removed a now unnecessary spin_unlock.
Neatened alignment and whitespace.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/usbip/vhci_hcd.c')
-rw-r--r-- | drivers/staging/usbip/vhci_hcd.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 216648d..f1ca084 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c @@ -434,16 +434,13 @@ static void vhci_tx_urb(struct urb *urb) } priv = kzalloc(sizeof(struct vhci_priv), GFP_ATOMIC); - - spin_lock(&vdev->priv_lock); - if (!priv) { - dev_err(&urb->dev->dev, "malloc vhci_priv\n"); - spin_unlock(&vdev->priv_lock); usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); return; } + spin_lock(&vdev->priv_lock); + priv->seqnum = atomic_inc_return(&the_controller->seqnum); if (priv->seqnum == 0xffff) dev_info(&urb->dev->dev, "seqnum max\n"); @@ -684,7 +681,6 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) /* setup CMD_UNLINK pdu */ unlink = kzalloc(sizeof(struct vhci_unlink), GFP_ATOMIC); if (!unlink) { - pr_err("malloc vhci_unlink\n"); spin_unlock(&vdev->priv_lock); spin_unlock(&the_controller->lock); usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); |