diff options
author | Eva Rachel Retuya <eraretuya@gmail.com> | 2016-02-27 12:39:25 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-12 06:09:09 (GMT) |
commit | e2e77528a7dc80a9b5ff978a84b40e403ba9809d (patch) | |
tree | b0b7518c9c1c8dce41f2708a06a2cc947a2f15c8 /drivers/staging/wlan-ng | |
parent | 94889150a1a0173d4c369e272c3f46560a3f7898 (diff) | |
download | linux-e2e77528a7dc80a9b5ff978a84b40e403ba9809d.tar.xz |
staging: wlan-ng: simplify NULL tests
Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for
consistency. Coccinelle semantic patch used:
@@
identifier func;
expression x;
statement Z;
@@
x = func(...);
if (
(
+ !
x
- == NULL
|
+ !
- NULL ==
x
)
) Z
Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/hfa384x_usb.c | 14 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2fw.c | 2 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2usb.c | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 602c3f3..21a92df 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -328,7 +328,7 @@ static int submit_rx_urb(hfa384x_t *hw, gfp_t memflags) int result; skb = dev_alloc_skb(sizeof(hfa384x_usbin_t)); - if (skb == NULL) { + if (!skb) { result = -ENOMEM; goto done; } @@ -1298,7 +1298,7 @@ hfa384x_docmd(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx; ctlx = usbctlx_alloc(); - if (ctlx == NULL) { + if (!ctlx) { result = -ENOMEM; goto done; } @@ -1388,7 +1388,7 @@ hfa384x_dorrid(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx; ctlx = usbctlx_alloc(); - if (ctlx == NULL) { + if (!ctlx) { result = -ENOMEM; goto done; } @@ -1469,7 +1469,7 @@ hfa384x_dowrid(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx; ctlx = usbctlx_alloc(); - if (ctlx == NULL) { + if (!ctlx) { result = -ENOMEM; goto done; } @@ -1557,7 +1557,7 @@ hfa384x_dormem(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx; ctlx = usbctlx_alloc(); - if (ctlx == NULL) { + if (!ctlx) { result = -ENOMEM; goto done; } @@ -1650,7 +1650,7 @@ hfa384x_dowmem(hfa384x_t *hw, pr_debug("page=0x%04x offset=0x%04x len=%d\n", page, offset, len); ctlx = usbctlx_alloc(); - if (ctlx == NULL) { + if (!ctlx) { result = -ENOMEM; goto done; } @@ -3446,7 +3446,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev, } skb = dev_alloc_skb(skblen); - if (skb == NULL) + if (!skb) return; /* only prepend the prism header if in the right mode */ diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index 8fc80df..8d6ab72 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -538,7 +538,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt) /* Allocate buffer space for chunks */ for (i = 0; i < *ccnt; i++) { clist[i].data = kzalloc(clist[i].len, GFP_KERNEL); - if (clist[i].data == NULL) { + if (!clist[i].data) { pr_err("failed to allocate image space, exitting.\n"); return 1; } diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c index ae6a53c..41358bb 100644 --- a/drivers/staging/wlan-ng/prism2usb.c +++ b/drivers/staging/wlan-ng/prism2usb.c @@ -67,7 +67,7 @@ static int prism2sta_probe_usb(struct usb_interface *interface, dev = interface_to_usbdev(interface); wlandev = create_wlan(); - if (wlandev == NULL) { + if (!wlandev) { dev_err(&interface->dev, "Memory allocation failure.\n"); result = -EIO; goto failed; |