Staging: rtl8712: rtl8712_recv: Use !x instead of x == NULL
authorSandhya Bankar <bankarsandhya512@gmail.com>
Tue, 20 Sep 2016 09:04:36 +0000 (14:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2016 11:38:00 +0000 (13:38 +0200)
Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl8712_recv.c

index 4027d1a18415eebe9f6226f34a531f04153670e3..66f0e0a35167df655ea07c3c59302633a185e825 100644 (file)
@@ -60,7 +60,7 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter)
        _init_queue(&precvpriv->free_recv_buf_queue);
        precvpriv->pallocated_recv_buf =
                kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC);
-       if (precvpriv->pallocated_recv_buf == NULL)
+       if (!precvpriv->pallocated_recv_buf)
                return _FAIL;
        precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 -
                              ((addr_t) (precvpriv->pallocated_recv_buf) & 3);
@@ -274,7 +274,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter,
        fragnum = pfhdr->attrib.frag_num;
        psta_addr = pfhdr->attrib.ta;
        psta = r8712_get_stainfo(pstapriv, psta_addr);
-       if (psta == NULL)
+       if (!psta)
                pdefrag_q = NULL;
        else
                pdefrag_q = &psta->sta_recvpriv.defrag_q;
@@ -999,15 +999,15 @@ int recv_func(struct _adapter *padapter, void *pcontext)
        }
        process_phy_info(padapter, prframe);
        prframe = r8712_decryptor(padapter, prframe);
-       if (prframe == NULL) {
+       if (!prframe) {
                retval = _FAIL;
                goto _exit_recv_func;
        }
        prframe = r8712_recvframe_chk_defrag(padapter, prframe);
-       if (prframe == NULL)
+       if (!prframe)
                goto _exit_recv_func;
        prframe = r8712_portctrl(padapter, prframe);
-       if (prframe == NULL) {
+       if (!prframe) {
                retval = _FAIL;
                goto _exit_recv_func;
        }
@@ -1065,7 +1065,7 @@ static int recvbuf2recvframe(struct _adapter *padapter, struct sk_buff *pskb)
                if ((le32_to_cpu(prxstat->rxdw0) >> 23) & 0x01)
                        shift_sz = 2;
                precvframe = r8712_alloc_recvframe(pfree_recv_queue);
-               if (precvframe == NULL)
+               if (!precvframe)
                        goto  _exit_recvbuf2recvframe;
                INIT_LIST_HEAD(&precvframe->u.hdr.list);
                precvframe->u.hdr.precvbuf = NULL; /*can't access the precvbuf*/