diff options
author | Alison Schofield <amsfield22@gmail.com> | 2016-02-10 23:06:45 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-11 20:00:30 -0800 |
commit | 27f31cf9f7235cb3aa10860bf4fde5df6893bf52 (patch) | |
tree | 335fbab90c7dfd5e8a5132d855e00b9528655cd7 /drivers/staging/vt6656 | |
parent | e3b07865f5f6962d83e8b94d2968a9cfab7bdce5 (diff) | |
download | linux-27f31cf9f7235cb3aa10860bf4fde5df6893bf52.tar.gz linux-27f31cf9f7235cb3aa10860bf4fde5df6893bf52.tar.bz2 linux-27f31cf9f7235cb3aa10860bf4fde5df6893bf52.zip |
staging: vt6656: replace explicit NULL comparison with ! operator
Replace explicit NULL comparison with ! operator to simplify code.
Found with Coccinelle:
@@
expression e;
statement s0, s1;
@@
if (
(
+ !
e
- == NULL
|| ...
)
) s0 else s1
Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r-- | drivers/staging/vt6656/main_usb.c | 10 | ||||
-rw-r--r-- | drivers/staging/vt6656/usbpipe.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index a2f23aefb35d..05f86ff8875c 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -431,7 +431,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) for (ii = 0; ii < priv->num_tx_context; ii++) { tx_context = kmalloc(sizeof(struct vnt_usb_send_context), GFP_KERNEL); - if (tx_context == NULL) + if (!tx_context) goto free_tx; priv->tx_context[ii] = tx_context; @@ -462,13 +462,13 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) /* allocate URBs */ rcb->urb = usb_alloc_urb(0, GFP_ATOMIC); - if (rcb->urb == NULL) { + if (!rcb->urb) { dev_err(&priv->usb->dev, "Failed to alloc rx urb\n"); goto free_rx_tx; } rcb->skb = dev_alloc_skb(priv->rx_buf_sz); - if (rcb->skb == NULL) + if (!rcb->skb) goto free_rx_tx; rcb->in_use = false; @@ -479,13 +479,13 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) } priv->interrupt_urb = usb_alloc_urb(0, GFP_ATOMIC); - if (priv->interrupt_urb == NULL) { + if (!priv->interrupt_urb) { dev_err(&priv->usb->dev, "Failed to alloc int urb\n"); goto free_rx_tx; } priv->int_buf.data_buf = kmalloc(MAX_INTERRUPT_SIZE, GFP_KERNEL); - if (priv->int_buf.data_buf == NULL) { + if (!priv->int_buf.data_buf) { usb_free_urb(priv->interrupt_urb); goto free_rx_tx; } diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 351a99f3d684..bec5bafaca3c 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -210,7 +210,7 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb) struct urb *urb; urb = rcb->urb; - if (rcb->skb == NULL) { + if (!rcb->skb) { dev_dbg(&priv->usb->dev, "rcb->skb is null\n"); return status; } |