u8 match = false;
        u8 eid, wps_oui[4] = {0x0, 0x50, 0xf2, 0x04};
 
-       if (ie_ptr == NULL)
+       if (!ie_ptr)
                return match;
 
        eid = ie_ptr[0];
 {
        u8 mac[ETH_ALEN];
 
-       if (mac_addr == NULL)
+       if (!mac_addr)
                return;
 
        if (rtw_initmac && mac_pton(rtw_initmac, mac)) {
 
 
        RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("+rtw_set_802_11_bssid_list_scan(), fw_state =%x\n", get_fwstate(pmlmepriv)));
 
-       if (padapter == NULL) {
+       if (!padapter) {
                res = false;
                goto exit;
        }
 
        struct xmit_buf                         *pxmitbuf;
 
        pmgntframe = rtw_alloc_xmitframe(pxmitpriv);
-       if (pmgntframe == NULL) {
+       if (!pmgntframe) {
                DBG_88E("%s, alloc xmitframe fail\n", __func__);
                return NULL;
        }
 
        pxmitbuf = rtw_alloc_xmitbuf_ext(pxmitpriv);
-       if (pxmitbuf == NULL) {
+       if (!pxmitbuf) {
                DBG_88E("%s, alloc xmitbuf fail\n", __func__);
                rtw_free_xmitframe(pxmitpriv, pmgntframe);
                return NULL;
        u8      bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL) {
+       if (!pmgntframe) {
                DBG_88E("%s, alloc mgnt frame fail\n", __func__);
                return;
        }
        unsigned int    rate_len;
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL) {
+       if (!pmgntframe) {
                DBG_88E("%s, alloc mgnt frame fail\n", __func__);
                return;
        }
        RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+issue_probereq\n"));
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
        DBG_88E("%s\n", __func__);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        struct wlan_bssid_ex    *pnetwork = &(pmlmeinfo->network);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
 
        /* RSN */
        p = rtw_get_ie((pmlmeinfo->network.IEs + sizeof(struct ndis_802_11_fixed_ie)), _RSN_IE_2_, &ie_len, (pmlmeinfo->network.IELength - sizeof(struct ndis_802_11_fixed_ie)));
-       if (p != NULL)
+       if (p)
                pframe = rtw_set_ie(pframe, _RSN_IE_2_, ie_len, (p + 2), &(pattrib->pktlen));
 
        /* HT caps */
        pnetwork = &(pmlmeinfo->network);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
        DBG_88E("%s\n", __func__);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
        DBG_88E("%s, category=%d, action=%d, status=%d\n", __func__, category, action, status);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
                                                  &pattrib->pktlen);
 
                        psta = rtw_get_stainfo(pstapriv, raddr);
-                       if (psta != NULL) {
+                       if (psta) {
                                start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07]&0xfff) + 1;
 
                                DBG_88E("BA_starting_seqctrl=%d for TID=%d\n", start_seq, status & 0x07);
        action = ACT_PUBLIC_BSSCOEXIST;
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
 
        /*  checking SSID */
        p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset);
-       if (p == NULL) {
+       if (!p) {
                DBG_88E("marc: cannot find SSID for survey event\n");
                return _FAIL;
        }
        }
 
        p = rtw_get_ie(bssid->IEs + ie_offset, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset);
-       if (p != NULL) {
+       if (p) {
                if (len > (NDIS_802_11_LENGTH_RATES_EX-i)) {
                        DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
                        return _FAIL;
                        len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_);
 
        /* check (wildcard) SSID */
-       if (p != NULL) {
+       if (p) {
                if ((ielen != 0 && memcmp((void *)(p+2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength)) ||
                    (ielen == 0 && pmlmeinfo->hidden_ssid_mode))
                        return _SUCCESS;
        }
 
        pstat = rtw_get_stainfo(pstapriv, sa);
-       if (pstat == NULL) {
+       if (!pstat) {
                /*  allocate a new one */
                DBG_88E("going to alloc stainfo for sa=%pM\n", sa);
                pstat = rtw_alloc_stainfo(pstapriv, sa);
-               if (pstat == NULL) {
+               if (!pstat) {
                        DBG_88E(" Exceed the upper limit of supported clients...\n");
                        status = _STATS_UNABLE_HANDLE_STA_;
                        goto auth_fail;
        }
 
        pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
-       if (pstat == NULL) {
+       if (!pstat) {
                status = _RSON_CLS2_;
                goto asoc_class2_error;
        }
        /*  checking SSID */
        p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, &ie_len,
                pkt_len - WLAN_HDR_A3_LEN - ie_offset);
-       if (p == NULL)
+       if (!p)
                status = _STATS_FAILURE_;
 
        if (ie_len == 0) { /*  broadcast ssid, however it is not allowed in assocreq */
                goto OnAssocReqFail;
 
        pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS);
-       if (wpa_ie == NULL) {
+       if (!wpa_ie) {
                if (elems.wps_ie) {
                        DBG_88E("STA included WPS IE in "
                                   "(Re)Association Request - assume WPS is "
        addr = GetAddr2Ptr(pframe);
        psta = rtw_get_stainfo(pstapriv, addr);
 
-       if (psta == NULL)
+       if (!psta)
                return _SUCCESS;
 
        frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
        }
        ptable += index;
 
-       if (psta != NULL) {
+       if (psta) {
                if (GetRetry(pframe)) {
                        if (precv_frame->attrib.seq_num ==
                            psta->RxMgmtFrameSeqNum) {
 
                rx_chk_limit = 4;
                psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
-               if (psta != NULL) {
+               if (psta) {
                        bool is_p2p_enable = false;
 
                        if (!chk_ap_is_alive(padapter, psta))
                        if (pmlmeinfo->FW_sta_info[i].status == 1) {
                                psta = pmlmeinfo->FW_sta_info[i].psta;
 
-                               if (psta == NULL)
+                               if (!psta)
                                        continue;
                                if (pmlmeinfo->FW_sta_info[i].rx_pkt == sta_rx_pkts(psta)) {
                                        if (pmlmeinfo->FW_sta_info[i].retry < 3) {
 
                          prxattrib->ra[3], prxattrib->ra[4], prxattrib->ra[5]));
 
                /* calculate mic code */
-               if (stainfo != NULL) {
+               if (stainfo) {
                        if (IS_MCAST(prxattrib->ra)) {
                                if (!psecuritypriv) {
                                        res = _FAIL;
        RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("+validate_recv_mgnt_frame\n"));
 
        precv_frame = recvframe_chk_defrag(padapter, precv_frame);
-       if (precv_frame == NULL) {
+       if (!precv_frame) {
                RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_,
                         ("%s: fragment packet\n", __func__));
                return _SUCCESS;
        psa = get_sa(ptr);
        pbssid = get_hdr_bssid(ptr);
 
-       if (pbssid == NULL) {
+       if (!pbssid) {
                ret = _FAIL;
                goto exit;
        }
        else if (ret == RTW_RX_HANDLED)
                goto exit;
 
-       if (psta == NULL) {
+       if (!psta) {
                RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" after to_fr_ds_chk; psta==NULL\n"));
                ret = _FAIL;
                goto exit;
 
        psta_addr = pfhdr->attrib.ta;
        psta = rtw_get_stainfo(pstapriv, psta_addr);
-       if (psta == NULL) {
+       if (!psta) {
                u8 type = GetFrameType(pfhdr->pkt->data);
 
                if (type != WIFI_DATA_TYPE) {
        if (ismfrag == 1) {
                /* 0~(n-1) fragment frame */
                /* enqueue to defraf_g */
-               if (pdefrag_q != NULL) {
+               if (pdefrag_q) {
                        if (fragnum == 0) {
                                /* the first fragment */
                                if (!list_empty(&pdefrag_q->queue))
        if ((ismfrag == 0) && (fragnum != 0)) {
                /* the last fragment frame */
                /* enqueue the last fragment */
-               if (pdefrag_q != NULL) {
+               if (pdefrag_q) {
                        phead = get_list_head(pdefrag_q);
                        list_add_tail(&pfhdr->list, phead);
 
        LedControl8188eu(padapter, LED_CTL_RX);
 
        prframe = decryptor(padapter, prframe);
-       if (prframe == NULL) {
+       if (!prframe) {
                RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("decryptor: drop pkt\n"));
                ret = _FAIL;
                goto _recv_data_drop;
        }
 
        prframe = recvframe_chk_defrag(padapter, prframe);
-       if (prframe == NULL) {
+       if (!prframe) {
                RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chk_defrag: drop pkt\n"));
                goto _recv_data_drop;
        }
 
        prframe = portctrl(padapter, prframe);
-       if (prframe == NULL) {
+       if (!prframe) {
                RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("portctrl: drop pkt\n"));
                ret = _FAIL;
                goto _recv_data_drop;
 
        /* 4 start to decrypt recvframe */
        if (prxattrib->encrypt == _TKIP_) {
                stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
-               if (stainfo != NULL) {
+               if (stainfo) {
                        if (IS_MCAST(prxattrib->ra)) {
                                if (!psecuritypriv->binstallGrpkey) {
                                        res = _FAIL;
                else
                        stainfo = rtw_get_stainfo(&padapter->stapriv, &pattrib->ra[0]);
 
-               if (stainfo != NULL) {
+               if (stainfo) {
                        RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo!= NULL!!!\n"));
 
                        if (IS_MCAST(pattrib->ra))
 
        struct ht_priv                  *phtpriv = &pmlmepriv->htpriv;
        u8 *HT_cap = (u8 *)(&pmlmeinfo->HT_caps);
 
-       if (pIE == NULL)
+       if (!pIE)
                return;
 
        if (!phtpriv->ht_option)
        struct mlme_priv                *pmlmepriv = &padapter->mlmepriv;
        struct ht_priv                  *phtpriv = &pmlmepriv->htpriv;
 
-       if (pIE == NULL)
+       if (!pIE)
                return;
 
        if (!phtpriv->ht_option)
        struct mlme_ext_info    *pmlmeinfo = &(pmlmeext->mlmext_info);
 
        pIE = (struct ndis_802_11_var_ie *)rtw_get_ie(pvar_ie, _SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
-       if (pIE == NULL)
+       if (!pIE)
                return _FAIL;
        if (ie_len > NDIS_802_11_LENGTH_RATES_EX)
                return _FAIL;
 
                psta = rtw_get_bcmc_stainfo(padapter);
        } else {
                psta = rtw_get_stainfo(pstapriv, pattrib->ra);
-               if (psta == NULL) { /*  if we cannot get psta => drrp the pkt */
+               if (!psta) { /*  if we cannot get psta => drrp the pkt */
                        RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra: %pM\n", (pattrib->ra)));
                        res = _FAIL;
                        goto exit;
 
        if (pattrib->encrypt == _TKIP_) {/* if (psecuritypriv->dot11PrivacyAlgrthm == _TKIP_PRIVACY_) */
                /* encode mic code */
-               if (stainfo != NULL) {
+               if (stainfo) {
                        u8 null_key[16] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
                                           0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
                                           0x0, 0x0};
 
        psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
 
-       if (psta == NULL)
+       if (!psta)
                return _FAIL;
 
        if (pxmitframe->buf_addr == NULL) {
        case AUTO_VCS:
        default:
                perp = rtw_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len);
-               if (perp == NULL) {
+               if (!perp) {
                        pxmitpriv->vcs = NONE_VCS;
                } else {
                        protection = (*(perp + 2)) & BIT(1);
        struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue;
 
 
-       if (pxmitbuf == NULL)
+       if (!pxmitbuf)
                return _FAIL;
 
        spin_lock_irqsave(&pfree_queue->lock, irql);
        unsigned long irql;
        struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
 
-       if (pxmitbuf == NULL)
+       if (!pxmitbuf)
                return _FAIL;
 
        if (pxmitbuf->sctx) {
        struct sk_buff *pndis_pkt = NULL;
 
 
-       if (pxmitframe == NULL) {
+       if (!pxmitframe) {
                RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("====== rtw_free_xmitframe():pxmitframe == NULL!!!!!!!!!!\n"));
                goto exit;
        }
        else
                psta = rtw_get_stainfo(pstapriv, pattrib->ra);
 
-       if (psta == NULL) {
+       if (!psta) {
                res = _FAIL;
                DBG_88E("rtw_xmit_classifier: psta == NULL\n");
                RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("rtw_xmit_classifier: psta == NULL\n"));
        s32 res;
 
        pxmitframe = rtw_alloc_xmitframe(pxmitpriv);
-       if (pxmitframe == NULL) {
+       if (!pxmitframe) {
                RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("rtw_xmit: no more pxmitframe\n"));
                DBG_88E("DBG_TX_DROP_FRAME %s no more pxmitframe\n", __func__);
                return -1;
        else
                psta = rtw_get_stainfo(pstapriv, pattrib->ra);
 
-       if (psta == NULL)
+       if (!psta)
                return ret;
 
        if (pattrib->triggered == 1) {