staging: rtl8712: Replace explicit NULL comparison
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Thu, 18 Feb 2016 18:54:30 +0000 (00:24 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 23:18:33 +0000 (15:18 -0800)
Replace explicit NULL comparison with ! operator.
Found with Coccinelle.

@@
expression e;
@@
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/xmit_linux.c

index d3981836ce26f322153bdd7838e1b77f59d70880..f8866d7aa668c18d2e262430737ba0f8f5a02a32 100644 (file)
@@ -131,7 +131,7 @@ int r8712_xmit_resource_alloc(struct _adapter *padapter,
 
        for (i = 0; i < 8; i++) {
                pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
-               if (pxmitbuf->pxmit_urb[i] == NULL) {
+               if (!pxmitbuf->pxmit_urb[i]) {
                        netdev_err(padapter->pnetdev, "pxmitbuf->pxmit_urb[i] == NULL\n");
                        return _FAIL;
                }
@@ -171,7 +171,7 @@ int r8712_xmit_entry(_pkt *pkt, struct  net_device *pnetdev)
                goto _xmit_entry_drop;
        }
        pxmitframe = r8712_alloc_xmitframe(pxmitpriv);
-       if (pxmitframe == NULL) {
+       if (!pxmitframe) {
                ret = 0;
                goto _xmit_entry_drop;
        }