]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: wlan-ng: simplify NULL tests
authorEva Rachel Retuya <eraretuya@gmail.com>
Sat, 27 Feb 2016 12:39:25 +0000 (20:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2016 06:09:09 +0000 (22:09 -0800)
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>
drivers/staging/wlan-ng/hfa384x_usb.c
drivers/staging/wlan-ng/prism2fw.c
drivers/staging/wlan-ng/prism2usb.c

index 602c3f379c82d07787e64de175a3d17e666681d7..21a92df85931408e0224c3a33951ea95eb48059e 100644 (file)
@@ -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 */
index 8fc80df0b53ef59735f9ff0417522efb0d4f2d46..8d6ab727fd453262ebd9dcb4ccd92fbc1473a79f 100644 (file)
@@ -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;
                }
index ae6a53cebf44a6ea863f326bfaf2df4ce1bb034c..41358bbc624673bf145b978098874dcb3eb6a91a 100644 (file)
@@ -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;