diff options
author | Ioana Ciornei <ciorneiioana@gmail.com> | 2015-10-18 15:51:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-24 19:02:42 -0700 |
commit | b6f6fd8a871cebc8085719c08ea489d1d98bb21e (patch) | |
tree | 399a69eb2045b0eb4eaba39bf56f0b9ebdb8c2f7 /drivers/staging/gdm724x/gdm_usb.c | |
parent | a4785ef8102390fa7e0e8865efd44036b7337e22 (diff) | |
download | op-kernel-dev-b6f6fd8a871cebc8085719c08ea489d1d98bb21e.zip op-kernel-dev-b6f6fd8a871cebc8085719c08ea489d1d98bb21e.tar.gz |
stating: gdm724x: remove explicit NULL comparison
This patch converts explicit NULL comparison to its shorter
equivalent form.
Done with coccinelle semantic patch:
@@
expression e;
@@
- e == NULL
+ !e
Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gdm724x/gdm_usb.c')
-rw-r--r-- | drivers/staging/gdm724x/gdm_usb.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c index 1c15b9c..f87dd61 100644 --- a/drivers/staging/gdm724x/gdm_usb.c +++ b/drivers/staging/gdm724x/gdm_usb.c @@ -338,7 +338,7 @@ static int init_usb(struct lte_udev *udev) for (i = 0; i < MAX_NUM_SDU_BUF; i++) { t_sdu = alloc_tx_sdu_struct(); - if (t_sdu == NULL) { + if (!t_sdu) { ret = -ENOMEM; goto fail; } @@ -349,7 +349,7 @@ static int init_usb(struct lte_udev *udev) for (i = 0; i < MAX_RX_SUBMIT_COUNT*2; i++) { r = alloc_rx_struct(); - if (r == NULL) { + if (!r) { ret = -ENOMEM; goto fail; } @@ -576,7 +576,7 @@ static int send_tx_packet(struct usb_device *usbdev, struct usb_tx *t, u32 len) { int ret = 0; - if (!(len%512)) + if (!(len % 512)) len++; usb_fill_bulk_urb(t->urb, @@ -682,7 +682,7 @@ static void do_tx(struct work_struct *work) } t = alloc_tx_struct(TX_BUF_SIZE); - if (t == NULL) { + if (!t) { spin_unlock_irqrestore(&tx->lock, flags); return; } @@ -732,7 +732,7 @@ static int gdm_usb_sdu_send(void *priv_dev, void *data, int len, t_sdu = get_tx_sdu_struct(tx, &no_spc); spin_unlock_irqrestore(&tx->lock, flags); - if (t_sdu == NULL) { + if (!t_sdu) { pr_err("sdu send - free list empty\n"); return TX_NO_SPC; } @@ -782,7 +782,7 @@ static int gdm_usb_hci_send(void *priv_dev, void *data, int len, } t = alloc_tx_struct(len); - if (t == NULL) { + if (!t) { pr_err("hci_send - out of memory\n"); return -ENOMEM; } @@ -1006,11 +1006,11 @@ static int __init gdm_usb_lte_init(void) } usb_tx_wq = create_workqueue("usb_tx_wq"); - if (usb_tx_wq == NULL) + if (!usb_tx_wq) return -1; usb_rx_wq = create_workqueue("usb_rx_wq"); - if (usb_rx_wq == NULL) + if (!usb_rx_wq) return -1; return usb_register(&gdm_usb_lte_driver); |