Commit e2e77528 authored by Eva Rachel Retuya's avatar Eva Rachel Retuya Committed by Greg Kroah-Hartman

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: default avatarEva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 94889150
...@@ -328,7 +328,7 @@ static int submit_rx_urb(hfa384x_t *hw, gfp_t memflags) ...@@ -328,7 +328,7 @@ static int submit_rx_urb(hfa384x_t *hw, gfp_t memflags)
int result; int result;
skb = dev_alloc_skb(sizeof(hfa384x_usbin_t)); skb = dev_alloc_skb(sizeof(hfa384x_usbin_t));
if (skb == NULL) { if (!skb) {
result = -ENOMEM; result = -ENOMEM;
goto done; goto done;
} }
...@@ -1298,7 +1298,7 @@ hfa384x_docmd(hfa384x_t *hw, ...@@ -1298,7 +1298,7 @@ hfa384x_docmd(hfa384x_t *hw,
hfa384x_usbctlx_t *ctlx; hfa384x_usbctlx_t *ctlx;
ctlx = usbctlx_alloc(); ctlx = usbctlx_alloc();
if (ctlx == NULL) { if (!ctlx) {
result = -ENOMEM; result = -ENOMEM;
goto done; goto done;
} }
...@@ -1388,7 +1388,7 @@ hfa384x_dorrid(hfa384x_t *hw, ...@@ -1388,7 +1388,7 @@ hfa384x_dorrid(hfa384x_t *hw,
hfa384x_usbctlx_t *ctlx; hfa384x_usbctlx_t *ctlx;
ctlx = usbctlx_alloc(); ctlx = usbctlx_alloc();
if (ctlx == NULL) { if (!ctlx) {
result = -ENOMEM; result = -ENOMEM;
goto done; goto done;
} }
...@@ -1469,7 +1469,7 @@ hfa384x_dowrid(hfa384x_t *hw, ...@@ -1469,7 +1469,7 @@ hfa384x_dowrid(hfa384x_t *hw,
hfa384x_usbctlx_t *ctlx; hfa384x_usbctlx_t *ctlx;
ctlx = usbctlx_alloc(); ctlx = usbctlx_alloc();
if (ctlx == NULL) { if (!ctlx) {
result = -ENOMEM; result = -ENOMEM;
goto done; goto done;
} }
...@@ -1557,7 +1557,7 @@ hfa384x_dormem(hfa384x_t *hw, ...@@ -1557,7 +1557,7 @@ hfa384x_dormem(hfa384x_t *hw,
hfa384x_usbctlx_t *ctlx; hfa384x_usbctlx_t *ctlx;
ctlx = usbctlx_alloc(); ctlx = usbctlx_alloc();
if (ctlx == NULL) { if (!ctlx) {
result = -ENOMEM; result = -ENOMEM;
goto done; goto done;
} }
...@@ -1650,7 +1650,7 @@ hfa384x_dowmem(hfa384x_t *hw, ...@@ -1650,7 +1650,7 @@ hfa384x_dowmem(hfa384x_t *hw,
pr_debug("page=0x%04x offset=0x%04x len=%d\n", page, offset, len); pr_debug("page=0x%04x offset=0x%04x len=%d\n", page, offset, len);
ctlx = usbctlx_alloc(); ctlx = usbctlx_alloc();
if (ctlx == NULL) { if (!ctlx) {
result = -ENOMEM; result = -ENOMEM;
goto done; goto done;
} }
...@@ -3446,7 +3446,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev, ...@@ -3446,7 +3446,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
} }
skb = dev_alloc_skb(skblen); skb = dev_alloc_skb(skblen);
if (skb == NULL) if (!skb)
return; return;
/* only prepend the prism header if in the right mode */ /* only prepend the prism header if in the right mode */
......
...@@ -538,7 +538,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt) ...@@ -538,7 +538,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt)
/* Allocate buffer space for chunks */ /* Allocate buffer space for chunks */
for (i = 0; i < *ccnt; i++) { for (i = 0; i < *ccnt; i++) {
clist[i].data = kzalloc(clist[i].len, GFP_KERNEL); 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"); pr_err("failed to allocate image space, exitting.\n");
return 1; return 1;
} }
......
...@@ -67,7 +67,7 @@ static int prism2sta_probe_usb(struct usb_interface *interface, ...@@ -67,7 +67,7 @@ static int prism2sta_probe_usb(struct usb_interface *interface,
dev = interface_to_usbdev(interface); dev = interface_to_usbdev(interface);
wlandev = create_wlan(); wlandev = create_wlan();
if (wlandev == NULL) { if (!wlandev) {
dev_err(&interface->dev, "Memory allocation failure.\n"); dev_err(&interface->dev, "Memory allocation failure.\n");
result = -EIO; result = -EIO;
goto failed; goto failed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment