tim_bitmap_le = cpu_to_le16(pstapriv->tim_bitmap);
 
                p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
-               if (p != NULL && tim_ielen > 0) {
+               if (p && tim_ielen > 0) {
                        tim_ielen += 2;
                        premainder_ie = p+tim_ielen;
                        tim_ie_offset = (int)(p - pie);
 
                        /*  get supported rates len */
                        p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_));
-                       if (p !=  NULL)
+                       if (p)
                                offset += tmp_len+2;
 
                        /* DS Parameter Set IE, len = 3 */
                i += (pIE->Length + 2);
        }
 
-       if (p != NULL && ielen > 0) {
+       if (p && ielen > 0) {
                ielen += 2;
 
                premainder_ie = p+ielen;
 
        p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, index, &ielen,
                       pnetwork->IELength - _FIXED_IE_LENGTH_);
-       if (p != NULL && ielen > 0) {
+       if (p && ielen > 0) {
                ielen += 2;
 
                premainder_ie = p+ielen;
        memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX);
        /*  get supported rates */
        p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
-       if (p !=  NULL) {
+       if (p) {
                memcpy(supportRate, p+2, ie_len);
                supportRateNum = ie_len;
        }
 
        /* get ext_supported rates */
        p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_);
-       if (p !=  NULL) {
+       if (p) {
                memcpy(supportRate+supportRateNum, p+2, ie_len);
                supportRateNum += ie_len;
        }
                        }
                        break;
                }
-               if ((p == NULL) || (ie_len == 0))
+               if (!p || ie_len == 0)
                        break;
        }
 
                                break;
                        }
 
-                       if ((p == NULL) || (ie_len == 0))
+                       if (!p || ie_len == 0)
                                break;
                }
        }
        psta = rtw_get_stainfo(&padapter->stapriv, pbss_network->MacAddress);
        if (!psta) {
                psta = rtw_alloc_stainfo(&padapter->stapriv, pbss_network->MacAddress);
-               if (psta == NULL)
+               if (!psta)
                        return _FAIL;
        }
 
 
        pwps_ie = rtw_get_wps_ie(ie+_FIXED_IE_LENGTH_, ielen-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
 
-       if (pwps_ie == NULL || wps_ielen == 0)
+       if (!pwps_ie || wps_ielen == 0)
                return;
 
        wps_offset = (uint)(pwps_ie-ie);
        }
 
        pwps_ie_src = pmlmepriv->wps_beacon_ie;
-       if (pwps_ie_src == NULL)
+       if (!pwps_ie_src)
                return;
 
        wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
 
 {
        /*  Caller must spin_lock already! */
        ent->next_hash = priv->nethash[hash];
-       if (ent->next_hash != NULL)
+       if (ent->next_hash)
                ent->next_hash->pprev_hash = &ent->next_hash;
        priv->nethash[hash] = ent;
        ent->pprev_hash = &priv->nethash[hash];
 {
        /*  Caller must spin_lock already! */
        *(ent->pprev_hash) = ent->next_hash;
-       if (ent->next_hash != NULL)
+       if (ent->next_hash)
                ent->next_hash->pprev_hash = ent->pprev_hash;
        ent->next_hash = NULL;
        ent->pprev_hash = NULL;
        spin_lock_bh(&priv->br_ext_lock);
 
        db = priv->nethash[__nat25_network_hash(networkAddr)];
-       while (db != NULL) {
+       while (db) {
                if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
                        if (!__nat25_has_expired(priv, db)) {
                                /*  replace the destination mac address */
        spin_lock_bh(&priv->br_ext_lock);
        hash = __nat25_network_hash(networkAddr);
        db = priv->nethash[hash];
-       while (db != NULL) {
+       while (db) {
                if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
                        memcpy(db->macAddr, macAddr, ETH_ALEN);
                        db->ageing_timer = jiffies;
                db = db->next_hash;
        }
        db = (struct nat25_network_db_entry *) rtw_malloc(sizeof(*db));
-       if (db == NULL) {
+       if (!db) {
                spin_unlock_bh(&priv->br_ext_lock);
                return;
        }
        for (i = 0; i < NAT25_HASH_SIZE; i++) {
                struct nat25_network_db_entry *f;
                f = priv->nethash[i];
-               while (f != NULL) {
+               while (f) {
                        struct nat25_network_db_entry *g;
 
                        g = f->next_hash;
                struct nat25_network_db_entry *f;
                f = priv->nethash[i];
 
-               while (f != NULL) {
+               while (f) {
                        struct nat25_network_db_entry *g;
                        g = f->next_hash;
 
        unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
        unsigned int tmp;
 
-       if (skb == NULL)
+       if (!skb)
                return -1;
 
        if ((method <= NAT25_MIN) || (method >= NAT25_MAX))
                }
 
                /*   IPX   */
-               if (ipx != NULL) {
+               if (ipx) {
                        switch (method) {
                        case NAT25_CHECK:
                                if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
                        default:
                                return -1;
                        }
-               } else if (ea != NULL) {
+               } else if (ea) {
                        /* Sanity check fields. */
                        if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN) {
                                DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");
                        default:
                                return -1;
                        }
-               } else if (ddp != NULL) {
+               } else if (ddp) {
                        switch (method) {
                        case NAT25_CHECK:
                                return -1;
                                        int offset = 0;
 
                                        ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID));
-                                       if (ptr == NULL) {
+                                       if (!ptr) {
                                                DEBUG_ERR("Fail to find PTT_RELAY_SID in FADO!\n");
                                                return -1;
                                        }
 
 void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb)
 {
-       if (skb == NULL)
+       if (!skb)
                return;
 
        if (!priv->ethBrExtInfo.dhcp_bcst_disable) {
        __nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr);
        hash = __nat25_network_hash(networkAddr);
        db = priv->nethash[hash];
-       while (db != NULL) {
+       while (db) {
                if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
                        return (void *)db;
                }
 
        pcmdpriv->cmd_allocated_buf = kzalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ,
                                              GFP_KERNEL);
 
-       if (pcmdpriv->cmd_allocated_buf == NULL) {
+       if (!pcmdpriv->cmd_allocated_buf) {
                res = _FAIL;
                goto exit;
        }
 
        pcmdpriv->rsp_allocated_buf = kzalloc(MAX_RSPSZ + 4, GFP_KERNEL);
 
-       if (pcmdpriv->rsp_allocated_buf == NULL) {
+       if (!pcmdpriv->rsp_allocated_buf) {
                res = _FAIL;
                goto exit;
        }
 
        while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
                void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
-               if (c2h != NULL && c2h != (void *)pevtpriv)
+               if (c2h && c2h != (void *)pevtpriv)
                        kfree(c2h);
        }
        RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-rtw_free_evt_priv\n"));
 {
        unsigned long flags;
 
-       if (obj == NULL)
+       if (!obj)
                goto exit;
 
        spin_lock_irqsave(&queue->lock, flags);
        int res = _FAIL;
        struct adapter *padapter = pcmdpriv->padapter;
 
-       if (cmd_obj == NULL)
+       if (!cmd_obj)
                goto exit;
 
        cmd_obj->padapter = padapter;
                kfree(pcmd->parmbuf);
        }
 
-       if (pcmd->rsp != NULL) {
+       if (pcmd->rsp) {
                if (pcmd->rspsz != 0) {
                        /* free rsp in cmd_obj */
                        kfree(pcmd->rsp);
                /* call callback function for post-processed */
                if (pcmd->cmdcode < ARRAY_SIZE(rtw_cmd_callback)) {
                        pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
-                       if (pcmd_callback == NULL) {
+                       if (!pcmd_callback) {
                                RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("mlme_cmd_hdl(): pcmd_callback = 0x%p, cmdcode = 0x%x\n", pcmd_callback, pcmd->cmdcode));
                                rtw_free_cmd_obj(pcmd);
                        } else {
        /*  free all cmd_obj resources */
        do {
                pcmd = rtw_dequeue_cmd(pcmdpriv);
-               if (pcmd == NULL)
+               if (!pcmd)
                        break;
 
                /* DBG_88E("%s: leaving... drop cmdcode:%u\n", __func__, pcmd->cmdcode); */
        u8 ret = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                ret = _FAIL;
                goto exit;
        }
 
        psetusbsuspend = kzalloc(sizeof(struct usb_suspend_parm), GFP_ATOMIC);
-       if (psetusbsuspend == NULL) {
+       if (!psetusbsuspend) {
                kfree(ph2c);
                ret = _FAIL;
                goto exit;
        }
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL)
+       if (!ph2c)
                return _FAIL;
 
        psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_ATOMIC);
-       if (psurveyPara == NULL) {
+       if (!psurveyPara) {
                kfree(ph2c);
                return _FAIL;
        }
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        pbsetdataratepara = kzalloc(sizeof(struct setdatarate_parm), GFP_ATOMIC);
-       if (pbsetdataratepara == NULL) {
+       if (!pbsetdataratepara) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
        pssetbasicratepara = kzalloc(sizeof(struct setbasicrate_parm), GFP_ATOMIC);
 
-       if (pssetbasicratepara == NULL) {
+       if (!pssetbasicratepara) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
                }
        psetphypara = kzalloc(sizeof(struct setphy_parm), GFP_ATOMIC);
 
-       if (psetphypara == NULL) {
+       if (!psetphypara) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
                }
        pwritebbparm = kzalloc(sizeof(struct writeBB_parm), GFP_ATOMIC);
 
-       if (pwritebbparm == NULL) {
+       if (!pwritebbparm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
                }
        prdbbparm = kzalloc(sizeof(struct readBB_parm), GFP_ATOMIC);
 
-       if (prdbbparm == NULL) {
+       if (!prdbbparm) {
                kfree(ph2c);
                return _FAIL;
        }
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
        pwriterfparm = kzalloc(sizeof(struct writeRF_parm), GFP_ATOMIC);
 
-       if (pwriterfparm == NULL) {
+       if (!pwriterfparm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        prdrfparm = kzalloc(sizeof(struct readRF_parm), GFP_ATOMIC);
-       if (prdrfparm == NULL) {
+       if (!prdrfparm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
                RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
 
        pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
-       if (pcmd == NULL) {
+       if (!pcmd) {
                res = _FAIL;
                goto exit;
        }
        u8      res = _SUCCESS;
 
        pcmd = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (pcmd == NULL) {
+       if (!pcmd) {
                res = _FAIL;
                goto exit;
        }
        }
 
        pcmd = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (pcmd == NULL) {
+       if (!pcmd) {
                res = _FAIL;
                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n"));
                goto exit;
        }
 
        psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss;
-       if (psecnetwork == NULL) {
-               if (pcmd != NULL)
+       if (!psecnetwork) {
+               if (pcmd)
                        kfree(pcmd);
 
                res = _FAIL;
 
        /* prepare cmd parameter */
        param = kzalloc(sizeof(*param), GFP_ATOMIC);
-       if (param == NULL) {
+       if (!param) {
                res = _FAIL;
                goto exit;
        }
        if (enqueue) {
                /* need enqueue, prepare cmd_obj and enqueue */
                cmdobj = kzalloc(sizeof(*cmdobj), GFP_ATOMIC);
-               if (cmdobj == NULL) {
+               if (!cmdobj) {
                        res = _FAIL;
                        kfree(param);
                        goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = false;
                goto exit;
        }
        psetop = kzalloc(sizeof(struct setopmode_parm), GFP_KERNEL);
 
-       if (psetop == NULL) {
+       if (!psetop) {
                kfree(ph2c);
                res = false;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        psetstakey_para = kzalloc(sizeof(struct set_stakey_parm), GFP_KERNEL);
-       if (psetstakey_para == NULL) {
+       if (!psetstakey_para) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        }
 
        psetstakey_rsp = kzalloc(sizeof(struct set_stakey_rsp), GFP_KERNEL);
-       if (psetstakey_rsp == NULL) {
+       if (!psetstakey_rsp) {
                kfree(ph2c);
                kfree(psetstakey_para);
                res = _FAIL;
                clear_cam_entry(padapter, entry);
        } else {
                ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-               if (ph2c == NULL) {
+               if (!ph2c) {
                        res = _FAIL;
                        goto exit;
                }
 
                psetstakey_para = kzalloc(sizeof(struct set_stakey_parm),
                                          GFP_ATOMIC);
-               if (psetstakey_para == NULL) {
+               if (!psetstakey_para) {
                        kfree(ph2c);
                        res = _FAIL;
                        goto exit;
 
                psetstakey_rsp = kzalloc(sizeof(struct set_stakey_rsp),
                                         GFP_ATOMIC);
-               if (psetstakey_rsp == NULL) {
+               if (!psetstakey_rsp) {
                        kfree(ph2c);
                        kfree(psetstakey_para);
                        res = _FAIL;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
        psetrttblparm = kzalloc(sizeof(struct setratable_parm), GFP_KERNEL);
 
-       if (psetrttblparm == NULL) {
+       if (!psetrttblparm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
        pgetrttblparm = kzalloc(sizeof(struct getratable_parm), GFP_KERNEL);
 
-       if (pgetrttblparm == NULL) {
+       if (!pgetrttblparm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        psetassocsta_para = kzalloc(sizeof(struct set_assocsta_parm), GFP_ATOMIC);
-       if (psetassocsta_para == NULL) {
+       if (!psetassocsta_para) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        }
 
        psetassocsta_rsp = kzalloc(sizeof(struct set_assocsta_rsp), GFP_ATOMIC);
-       if (psetassocsta_rsp == NULL) {
+       if (!psetassocsta_rsp) {
                kfree(ph2c);
                kfree(psetassocsta_para);
                return _FAIL;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        paddbareq_parm = kzalloc(sizeof(struct addBaReq_parm), GFP_ATOMIC);
-       if (paddbareq_parm == NULL) {
+       if (!paddbareq_parm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC);
-       if (pdrvextra_cmd_parm == NULL) {
+       if (!pdrvextra_cmd_parm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
 
        /* prepare cmd parameter */
        set_ch_parm = kzalloc(sizeof(*set_ch_parm), GFP_ATOMIC);
-       if (set_ch_parm == NULL) {
+       if (!set_ch_parm) {
                res = _FAIL;
                goto exit;
        }
        if (enqueue) {
                /* need enqueue, prepare cmd_obj and enqueue */
                pcmdobj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-               if (pcmdobj == NULL) {
+               if (!pcmdobj) {
                        kfree(set_ch_parm);
                        res = _FAIL;
                        goto exit;
        /* prepare cmd parameter */
        setChannelPlan_param = kzalloc(sizeof(struct SetChannelPlan_param),
                                       GFP_KERNEL);
-       if (setChannelPlan_param == NULL) {
+       if (!setChannelPlan_param) {
                res = _FAIL;
                goto exit;
        }
        if (enqueue) {
                /* need enqueue, prepare cmd_obj and enqueue */
                pcmdobj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
-               if (pcmdobj == NULL) {
+               if (!pcmdobj) {
                        kfree(setChannelPlan_param);
                        res = _FAIL;
                        goto exit;
        RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_led_blink_cmd\n"));
 
        pcmdobj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (pcmdobj == NULL) {
+       if (!pcmdobj) {
                res = _FAIL;
                goto exit;
        }
 
        ledBlink_param = kzalloc(sizeof(struct LedBlink_param), GFP_ATOMIC);
-       if (ledBlink_param == NULL) {
+       if (!ledBlink_param) {
                kfree(pcmdobj);
                res = _FAIL;
                goto exit;
        RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_csa_cmd\n"));
 
        pcmdobj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (pcmdobj == NULL) {
+       if (!pcmdobj) {
                res = _FAIL;
                goto exit;
        }
 
        setChannelSwitch_param = kzalloc(sizeof(struct  SetChannelSwitch_param),
                                         GFP_ATOMIC);
-       if (setChannelSwitch_param == NULL) {
+       if (!setChannelSwitch_param) {
                kfree(pcmdobj);
                res = _FAIL;
                goto exit;
 
        if (enqueue) {
                ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-               if (ph2c == NULL) {
+               if (!ph2c) {
                        res = _FAIL;
                        goto exit;
                }
 
                pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm),
                                             GFP_ATOMIC);
-               if (pdrvextra_cmd_parm == NULL) {
+               if (!pdrvextra_cmd_parm) {
                        kfree(ph2c);
                        res = _FAIL;
                        goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm),
                                     GFP_ATOMIC);
-       if (pdrvextra_cmd_parm == NULL) {
+       if (!pdrvextra_cmd_parm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
 
        if (enqueue) {
                ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
-               if (ph2c == NULL) {
+               if (!ph2c) {
                        res = _FAIL;
                        goto exit;
                }
 
                pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm),
                                             GFP_KERNEL);
-               if (pdrvextra_cmd_parm == NULL) {
+               if (!pdrvextra_cmd_parm) {
                        kfree(ph2c);
                        res = _FAIL;
                        goto exit;
                return res;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC);
-       if (pdrvextra_cmd_parm == NULL) {
+       if (!pdrvextra_cmd_parm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ppscmd = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ppscmd == NULL) {
+       if (!ppscmd) {
                res = _FAIL;
                goto exit;
        }
 
        pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC);
-       if (pdrvextra_cmd_parm == NULL) {
+       if (!pdrvextra_cmd_parm) {
                kfree(ppscmd);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC);
-       if (pdrvextra_cmd_parm == NULL) {
+       if (!pdrvextra_cmd_parm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
        u8      res = _SUCCESS;
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC);
-       if (pdrvextra_cmd_parm == NULL) {
+       if (!pdrvextra_cmd_parm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
                psta = rtw_get_stainfo(&padapter->stapriv, pnetwork->MacAddress);
                if (!psta) {
                        psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
-                       if (psta == NULL) {
+                       if (!psta) {
                                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nCan't alloc sta_info when createbss_cmd_callback\n"));
                                goto createbss_cmd_fail ;
                        }
 
                pwlan = _rtw_alloc_network(pmlmepriv);
                spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
-               if (pwlan == NULL) {
+               if (!pwlan) {
                        pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue);
-                       if (pwlan == NULL) {
+                       if (!pwlan) {
                                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n Error:  can't get pwlan in rtw_joinbss_event_callback\n"));
                                spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
                                goto createbss_cmd_fail;
        struct set_stakey_rsp *psetstakey_rsp = (struct set_stakey_rsp *)(pcmd->rsp);
        struct sta_info *psta = rtw_get_stainfo(pstapriv, psetstakey_rsp->addr);
 
-       if (psta == NULL) {
+       if (!psta) {
                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n"));
                goto exit;
        }
        struct set_assocsta_rsp *passocsta_rsp = (struct set_assocsta_rsp *)(pcmd->rsp);
        struct sta_info *psta = rtw_get_stainfo(pstapriv, passocsta_parm->addr);
 
-       if (psta == NULL) {
+       if (!psta) {
                RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info\n\n"));
                goto exit;
        }
 
                return _FAIL;
 
        map = rtw_zmalloc(mapLen);
-       if (map == NULL)
+       if (!map)
                return _FAIL;
 
        ret = rtw_efuse_map_read(padapter, 0, mapLen, map);
                return _FAIL;
 
        map = rtw_zmalloc(mapLen);
-       if (map == NULL)
+       if (!map)
                return _FAIL;
 
        ret = rtw_BT_efuse_map_read(padapter, 0, mapLen, map);
 
        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];
 void rtw_macaddr_cfg(u8 *mac_addr)
 {
        u8 mac[ETH_ALEN];
-       if (mac_addr == NULL)
+       if (!mac_addr)
                return;
 
        if (rtw_initmac) {      /* Users specify the mac address */
        u8 *p2p_ie_ptr;
        u8 eid, p2p_oui[4] = {0x50, 0x6F, 0x9A, 0x09};
 
-       if (p2p_ielen != NULL)
+       if (p2p_ielen)
                *p2p_ielen = 0;
 
        while (cnt < in_len) {
                if ((eid == _VENDOR_SPECIFIC_IE_) && !memcmp(&in_ie[cnt+2], p2p_oui, 4)) {
                        p2p_ie_ptr = in_ie + cnt;
 
-                       if (p2p_ie != NULL)
+                       if (p2p_ie)
                                memcpy(p2p_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
-                       if (p2p_ielen != NULL)
+                       if (p2p_ielen)
                                *p2p_ielen = in_ie[cnt + 1] + 2;
                        return p2p_ie_ptr;
                } else {
 
        struct io_priv  *piopriv = &padapter->iopriv;
        struct intf_hdl *pintf = &piopriv->intf;
 
-       if (set_intf_ops == NULL)
+       if (!set_intf_ops)
                return _FAIL;
 
        piopriv->padapter = padapter;
 
 
        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;
        }
 {
        u8 ret = _SUCCESS;
 
-       if (keyindex >= 0x80000000 || padapter == NULL) {
+       if (keyindex >= 0x80000000 || !padapter) {
                ret = false;
                goto exit;
        } else {
                pbssid = get_bssid(&padapter->mlmepriv);
                stainfo = rtw_get_stainfo(&padapter->stapriv, pbssid);
 
-               if ((stainfo != NULL) && (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)) {
+               if (stainfo && padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
                        RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
                                 ("OID_802_11_ADD_KEY:(stainfo!=NULL)&&(Adapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)\n"));
                        encryptionalgo = stainfo->dot118021XPrivacy;
                         ("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11AuthAlgrthm==%d)!\n",
                         padapter->securitypriv.dot11AuthAlgrthm));
 
-               if ((stainfo != NULL))
+               if (stainfo)
                        RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
                                 ("rtw_set_802_11_add_key: (stainfo->dot118021XPrivacy==%d)!\n",
                                 stainfo->dot118021XPrivacy));
                pbssid = get_bssid(&padapter->mlmepriv);
                stainfo = rtw_get_stainfo(&padapter->stapriv, pbssid);
 
-               if (stainfo != NULL) {
+               if (stainfo) {
                        memset(&stainfo->dot118021x_UncstKey, 0, 16);/*  clear keybuffer */
 
                        memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16);
 
        struct xmit_priv        *pxmitpriv = &(adapter->xmitpriv);
 
        xmit_frame = rtw_alloc_xmitframe(pxmitpriv);
-       if (xmit_frame == NULL) {
+       if (!xmit_frame) {
                DBG_88E("%s rtw_alloc_xmitframe return null\n", __func__);
                goto exit;
        }
 
        xmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
-       if (xmitbuf == NULL) {
+       if (!xmitbuf) {
                DBG_88E("%s rtw_alloc_xmitbuf return null\n", __func__);
                rtw_free_xmitframe(pxmitpriv, xmit_frame);
                xmit_frame = NULL;
 
 
        pbuf = rtw_zvmalloc(MAX_BSS_CNT * (sizeof(struct wlan_network)));
 
-       if (pbuf == NULL) {
+       if (!pbuf) {
                res = _FAIL;
                goto exit;
        }
 int    _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork)
 {
 
-       if (pnetwork == NULL)
+       if (!pnetwork)
                goto exit;
 
        spin_lock_bh(&queue->lock);
        u32 lifetime = SCANQUEUE_LIFETIME;
        struct __queue *free_queue = &(pmlmepriv->free_bss_pool);
 
-       if (pnetwork == NULL)
+       if (!pnetwork)
                return;
 
        if (pnetwork->fixed)
 {
        struct __queue *free_queue = &(pmlmepriv->free_bss_pool);
 
-       if (pnetwork == NULL)
+       if (!pnetwork)
                return;
        if (pnetwork->fixed)
                return;
                pwlan = container_of(plist, struct wlan_network, list);
 
                if (!pwlan->fixed) {
-                       if (oldest == NULL || time_after(oldest->last_scanned, pwlan->last_scanned))
+                       if (!oldest || time_after(oldest->last_scanned, pwlan->last_scanned))
                                oldest = pwlan;
                }
 
 
                        pnetwork = rtw_alloc_network(pmlmepriv); /*  will update scan_time */
 
-                       if (pnetwork == NULL) {
+                       if (!pnetwork) {
                                RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n\nsomething wrong here\n\n\n"));
                                goto exit;
                        }
        privacy = pnetwork->network.Privacy;
 
        if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
-               if (rtw_get_wps_ie(pnetwork->network.IEs+_FIXED_IE_LENGTH_, pnetwork->network.IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen) != NULL)
+               if (rtw_get_wps_ie(pnetwork->network.IEs+_FIXED_IE_LENGTH_, pnetwork->network.IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen))
                        return true;
                else
                        return false;
        struct sta_priv *pstapriv = &padapter->stapriv;
 
        psta = rtw_get_stainfo(pstapriv, pnetwork->network.MacAddress);
-       if (psta == NULL)
+       if (!psta)
                psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress);
 
        if (psta) { /* update ptarget_sta */
                        /* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */
                        if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
                                ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
-                               if (ptarget_sta == NULL) {
+                               if (!ptarget_sta) {
                                        RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n"));
                                        spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
                                        goto ignore_joinbss_callback;
 #if defined (CONFIG_88EU_AP_MODE)
        if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                for (aid = (pstapriv->max_num_sta); aid > 0; aid--) {
-                       if (pstapriv->sta_aid[aid-1] != NULL)
+                       if (pstapriv->sta_aid[aid-1])
                                break;
                }
                mac_id = aid + 1;
        u16 media_status_rpt;
        u8 macid;
 
-       if (psta == NULL)
+       if (!psta)
                return;
 
        macid = search_max_mac_id(adapter);
 #endif
        /* for AD-HOC mode */
        psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
-       if (psta != NULL) {
+       if (psta) {
                /* the sta have been in sta_info_queue => do nothing */
                RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error: rtw_stassoc_event_callback: sta has been in sta_hash_queue\n"));
                return; /* between drv has received this event before and  fw have not yet to set key to CAM_ENTRY) */
        }
        psta = rtw_alloc_stainfo(&adapter->stapriv, pstassoc->macaddr);
-       if (psta == NULL) {
+       if (!psta) {
                RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't alloc sta_info when rtw_stassoc_event_callback\n"));
                return;
        }
                        goto exit;
        }
 
-       if (*candidate == NULL || (*candidate)->network.Rssi < competitor->network.Rssi) {
+       if (!*candidate || (*candidate)->network.Rssi < competitor->network.Rssi) {
                *candidate = competitor;
                updated = true;
        }
        pmlmepriv->pscanned = phead->next;
        while (phead != pmlmepriv->pscanned) {
                pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
-               if (pnetwork == NULL) {
+               if (!pnetwork) {
                        RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork==NULL)\n", __func__));
                        ret = _FAIL;
                        goto exit;
                pmlmepriv->pscanned = pmlmepriv->pscanned->next;
                rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
        }
-       if (candidate == NULL) {
+       if (!candidate) {
                DBG_88E("%s: return _FAIL(candidate==NULL)\n", __func__);
                ret = _FAIL;
                goto exit;
        int             res = _SUCCESS;
 
        pcmd = (struct  cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-       if (pcmd == NULL) {
+       if (!pcmd) {
                res = _FAIL;  /* try again */
                goto exit;
        }
 
        psetauthparm = (struct setauth_parm *)rtw_zmalloc(sizeof(struct setauth_parm));
-       if (psetauthparm == NULL) {
+       if (!psetauthparm) {
                kfree(pcmd);
                res = _FAIL;
                goto exit;
        int     res = _SUCCESS;
 
        pcmd = (struct  cmd_obj *)rtw_zmalloc(sizeof(struct     cmd_obj));
-       if (pcmd == NULL) {
+       if (!pcmd) {
                res = _FAIL;  /* try again */
                goto exit;
        }
        psetkeyparm = (struct setkey_parm *)rtw_zmalloc(sizeof(struct setkey_parm));
-       if (psetkeyparm == NULL) {
+       if (!psetkeyparm) {
                kfree(pcmd);
                res = _FAIL;
                goto exit;
        else
                psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
 
-       if (psta == NULL)
+       if (!psta)
                return;
 
        phtpriv = &psta->htpriv;
 
        struct wlan_network *pnetwork;
 
-       if (tgt_network != NULL)
+       if (tgt_network)
                pnetwork = tgt_network;
        else
                pnetwork = &pmlmepriv->cur_network;
 
                            ((BW40MINUS == o->bw) || (BW40PLUS == o->bw)))
                                continue;
 
-                       if (reg == NULL) {
+                       if (!reg) {
                                reg = &channel_list->reg_class[cla];
                                cla++;
                                reg->reg_class = o->op_class;
        }
        ptable += index;
 
-       if (psta != NULL) {
+       if (psta) {
                if (GetRetry(pframe)) {
                        if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum) {
                                /* drop the duplicate management frame */
                        len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_);
 
        /* check (wildcard) SSID */
-       if (p != NULL) {
+       if (p) {
                if (is_valid_p2p_probereq)
                        goto _issue_probersp;
 
 
                if (((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
                        psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
-                       if (psta != NULL) {
+                       if (psta) {
                                ret = rtw_check_bcn_info(padapter, pframe, len);
                                if (!ret) {
                                                DBG_88E_LEVEL(_drv_info_, "ap has changed, disconnect now\n ");
                        }
                } else if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
                        psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
-                       if (psta != NULL) {
+                       if (psta) {
                                /* update WMM, ERP in the beacon */
                                /* todo: the timer is used instead of the number of the beacon received */
                                if ((sta_rx_pkts(psta) & 0xf) == 0)
        }
 
        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;
                        p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_, _CHLGETXT_IE_, (int *)&ie_len,
                                        len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_ - 4);
 
-                       if ((p == NULL) || (ie_len <= 0)) {
+                       if (!p || ie_len <= 0) {
                                DBG_88E("auth rejected because challenge failure!(1)\n");
                                status = _STATS_CHALLENGE_FAIL_;
                                goto auth_fail;
                        p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, _CHLGETXT_IE_, (int *)&len,
                                pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_);
 
-                       if (p == NULL)
+                       if (!p)
                                goto authclnt_fail;
 
                        memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len);
        /*  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 */
 
        /*  check if the supported rate is ok */
        p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SUPPORTEDRATES_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
-       if (p == NULL) {
+       if (!p) {
                DBG_88E("Rx a sta assoc-req which supported rate is empty!\n");
                /*  use our own rate set as statoin used */
                /* memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN); */
 
                p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _EXT_SUPPORTEDRATES_IE_, &ie_len,
                                pkt_len - WLAN_HDR_A3_LEN - ie_offset);
-               if (p !=  NULL) {
+               if (p) {
                        if (supportRateNum <= sizeof(supportRate)) {
                                memcpy(supportRate+supportRateNum, p+2, ie_len);
                                supportRateNum += ie_len;
                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 "
                p = pframe + WLAN_HDR_A3_LEN + ie_offset; ie_len = 0;
                for (;;) {
                        p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
-                       if (p != NULL) {
+                       if (p) {
                                if (!memcmp(p+2, WMM_IE, 6)) {
                                        pstat->flags |= WLAN_STA_WME;
 
                DBG_88E("  old AID %d\n", pstat->aid);
        } else {
                for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++)
-                       if (pstapriv->sta_aid[pstat->aid - 1] == NULL)
+                       if (!pstapriv->sta_aid[pstat->aid - 1])
                                break;
 
                /* if (pstat->aid > NUM_STA) { */
        addr = GetAddr2Ptr(pframe);
        psta = rtw_get_stainfo(pstapriv, addr);
 
-       if (psta == NULL)
+       if (!psta)
                return _SUCCESS;
 
        frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
        struct wifidirect_info  *pwdinfo = &(padapter->wdinfo);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        DBG_88E("[%s] In\n", __func__);
        struct wifidirect_info  *pwdinfo = &(padapter->wdinfo);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        DBG_88E("[%s] In, result=%d\n", __func__,  result);
        struct wifidirect_info  *pwdinfo = &(padapter->wdinfo);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        DBG_88E("[%s] In\n", __func__);
        struct wifidirect_info  *pwdinfo = &(padapter->wdinfo);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        struct wifidirect_info  *pwdinfo = &(padapter->wdinfo);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        struct wifidirect_info  *pwdinfo = &(padapter->wdinfo);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        DBG_88E("[%s] In\n", __func__);
        u32                                     wpsielen = 0, p2pielen = 0;
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
        /*      Value: */
        wpsie[wpsielen++] = WPS_VERSION_1;      /*      Version 1.0 */
 
-       if (pmlmepriv->wps_probe_req_ie == NULL) {
+       if (!pmlmepriv->wps_probe_req_ie) {
                /*      UUID-E */
                /*      Type: */
                *(__be16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_UUID_E);
 
        pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *)p2pie, &pattrib->pktlen);
 
-       if (pmlmepriv->wps_probe_req_ie != NULL) {
+       if (pmlmepriv->wps_probe_req_ie) {
                /* WPS IE */
                memcpy(pframe, pmlmepriv->wps_probe_req_ie, pmlmepriv->wps_probe_req_ie_len);
                pattrib->pktlen += pmlmepriv->wps_probe_req_ie_len;
        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;
 #endif /* CONFIG_88EU_P2P */
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL) {
+       if (!pmgntframe) {
                DBG_88E("%s, alloc mgnt frame fail\n", __func__);
                return;
        }
 #endif /* CONFIG_88EU_P2P */
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL) {
+       if (!pmgntframe) {
                DBG_88E("%s, alloc mgnt frame fail\n", __func__);
                return;
        }
                pwps_ie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
 
                /* inerset & update wps_probe_resp_ie */
-               if ((pmlmepriv->wps_probe_resp_ie != NULL) && pwps_ie && (wps_ielen > 0)) {
+               if (pmlmepriv->wps_probe_resp_ie && pwps_ie && wps_ielen > 0) {
                        uint wps_offset, remainder_ielen;
                        u8 *premainder_ie;
 
        RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+issue_probereq\n"));
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
        struct mlme_ext_info    *pmlmeinfo = &(pmlmeext->mlmext_info);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        DBG_88E("%s\n", __func__);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
                                break;
                        }
 
-                       if ((pbuf == NULL) || (ie_len == 0))
+                       if (!pbuf || ie_len == 0)
                                break;
                }
        }
 #endif /* CONFIG_88EU_P2P */
 
        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 */
        if (padapter->mlmepriv.htpriv.ht_option) {
                p = rtw_get_ie((pmlmeinfo->network.IEs + sizeof(struct ndis_802_11_fixed_ie)), _HT_CAPABILITY_IE_, &ie_len, (pmlmeinfo->network.IELength - sizeof(struct ndis_802_11_fixed_ie)));
-               if ((p != NULL) && (!(is_ap_in_tkip(padapter)))) {
+               if (p && !is_ap_in_tkip(padapter)) {
                        memcpy(&(pmlmeinfo->HT_caps), (p + 2), sizeof(struct HT_caps_element));
 
                        /* to disable 40M Hz support while gd_bw_40MHz_en = 0 */
        pmlmeinfo = &(pmlmeext->mlmext_info);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
        struct mlme_ext_info    *pmlmeinfo = &(pmlmeext->mlmext_info);
 
        /* da == NULL, assum it's null data for sta to ap*/
-       if (da == NULL)
+       if (!da)
                da = get_my_bssid(&(pmlmeinfo->network));
 
        do {
        DBG_88E("%s\n", __func__);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
        struct mlme_ext_info    *pmlmeinfo = &(pmlmeext->mlmext_info);
 
        /* da == NULL, assum it's null data for sta to ap*/
-       if (da == NULL)
+       if (!da)
                da = get_my_bssid(&(pmlmeinfo->network));
 
        do {
 #endif /* CONFIG_88EU_P2P */
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
                FUNC_NDEV_ARG(padapter->pnetdev), ra, new_ch, ch_offset);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* 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 */
                        pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(le_tmp)), &(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 */
                        pbss_network = (struct wlan_bssid_ex *)&pnetwork->network;
 
                        p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->IELength - _FIXED_IE_LENGTH_);
-                       if ((p == NULL) || (len == 0)) { /* non-HT */
+                       if (!p || len == 0) { /* non-HT */
                                if ((pbss_network->Configuration.DSConfig <= 0) || (pbss_network->Configuration.DSConfig > 14))
                                        continue;
 
                        return _SUCCESS;
 
        psta = rtw_get_stainfo(pstapriv, addr);
-       if (psta == NULL)
+       if (!psta)
                return _SUCCESS;
 
        if (initiator == 0) { /*  recipient */
 
        /*  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;
        }
        /* checking rate info... */
        i = 0;
        p = rtw_get_ie(bssid->IEs + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset);
-       if (p != NULL) {
+       if (p) {
                if (len > NDIS_802_11_LENGTH_RATES_EX) {
                        DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
                        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;
        pcmdpriv = &padapter->cmdpriv;
 
        pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-       if (pcmd_obj == NULL)
+       if (!pcmd_obj)
                return;
 
        cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header));
        pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
-       if (pevtcmd == NULL) {
+       if (!pevtcmd) {
                kfree(pcmd_obj);
                return;
        }
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 
        pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-       if (pcmd_obj == NULL)
+       if (!pcmd_obj)
                return;
 
        cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header));
        pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
-       if (pevtcmd == NULL) {
+       if (!pevtcmd) {
                kfree(pcmd_obj);
                return;
        }
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 
        pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-       if (pcmd_obj == NULL)
+       if (!pcmd_obj)
                return;
 
        cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header));
        pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
-       if (pevtcmd == NULL) {
+       if (!pevtcmd) {
                kfree(pcmd_obj);
                return;
        }
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 
        pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-       if (pcmd_obj == NULL)
+       if (!pcmd_obj)
                return;
 
        cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header));
        pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
-       if (pevtcmd == NULL) {
+       if (!pevtcmd) {
                kfree(pcmd_obj);
                return;
        }
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 
        pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-       if (pcmd_obj == NULL)
+       if (!pcmd_obj)
                return;
 
        cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header));
        pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
-       if (pevtcmd == NULL) {
+       if (!pevtcmd) {
                kfree(pcmd_obj);
                return;
        }
 
                rx_chk_limit = 4;
                psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
-               if (psta != NULL) {
+               if (psta) {
                        bool is_p2p_enable = false;
                        #ifdef CONFIG_88EU_P2P
                        is_p2p_enable = !rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE);
                }
 
                ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-               if (ph2c == NULL)
+               if (!ph2c)
                        goto exit_survey_timer_hdl;
 
                psurveyPara = (struct sitesurvey_parm *)rtw_zmalloc(sizeof(struct sitesurvey_parm));
-               if (psurveyPara == NULL) {
+               if (!psurveyPara) {
                        kfree(ph2c);
                        goto exit_survey_timer_hdl;
                }
        int len_diff = 0;
 
        ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-       if (ph2c == NULL) {
+       if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
        ptxBeacon_parm = (struct Tx_Beacon_param *)rtw_zmalloc(sizeof(struct Tx_Beacon_param));
-       if (ptxBeacon_parm == NULL) {
+       if (!ptxBeacon_parm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;
 
                rtw_free_stainfo(padapter, psta);
 
        psta = rtw_alloc_stainfo(&padapter->stapriv, bssid.MacAddress);
-       if (psta == NULL) {
+       if (!psta) {
                RT_TRACE(_module_mp_, _drv_err_, ("mp_start_test: Can't alloc sta_info!\n"));
                pmlmepriv->fw_state = pmppriv->prev_fw_state;
                res = _FAIL;
        struct xmit_buf *pxmitbuf;
 
        pmpframe = rtw_alloc_xmitframe(pxmitpriv);
-       if (pmpframe == NULL)
+       if (!pmpframe)
                return NULL;
 
        pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
-       if (pxmitbuf == NULL) {
+       if (!pxmitbuf) {
                rtw_free_xmitframe(pxmitpriv, pmpframe);
                return NULL;
        }
        /* DBG_88E("%s:pkTx Start\n", __func__); */
        while (1) {
                pxmitframe = alloc_mp_xmitframe(pxmitpriv);
-               if (pxmitframe == NULL) {
+               if (!pxmitframe) {
                        if (pmptx->stop ||
                            padapter->bSurpriseRemoved ||
                            padapter->bDriverStopped) {
        pmp_priv->tx.write_size = pkt_size;
        pmp_priv->tx.buf_size = pkt_size + XMITBUF_ALIGN_SZ;
        pmp_priv->tx.pallocated_buf = rtw_zmalloc(pmp_priv->tx.buf_size);
-       if (pmp_priv->tx.pallocated_buf == NULL) {
+       if (!pmp_priv->tx.pallocated_buf) {
                DBG_88E("%s: malloc(%d) fail!!\n", __func__, pmp_priv->tx.buf_size);
                return;
        }
 
        pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
 
-       if (pxmitpriv->pallocated_xmit_extbuf  == NULL) {
+       if (!pxmitpriv->pallocated_xmit_extbuf) {
                RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_extbuf fail!\n"));
                res = _FAIL;
                goto exit;
 
        DBG_88E("[%s]\n", __func__);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        DBG_88E("[%s]\n", __func__);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        struct mlme_ext_priv    *pmlmeext = &(padapter->mlmeextpriv);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        DBG_88E("[%s]\n", __func__);
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                return;
 
        /* update attribute */
        if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
                p2pie = rtw_get_p2p_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_, NULL, &p2pielen);
                if (p2pie) {
-                       if ((p != NULL) && !memcmp((void *)(p+2), (void *)pwdinfo->p2p_wildcard_ssid, 7)) {
+                       if (p && !memcmp((void *)(p+2), (void *)pwdinfo->p2p_wildcard_ssid, 7)) {
                                /* todo: */
                                /* Check Requested Device Type attributes in WSC IE. */
                                /* Check Device ID attribute in P2P IE */
 
                                ret = true;
-                       } else if ((p != NULL) && (ssid_len == 0)) {
+                       } else if (p && ssid_len == 0) {
                                ret = true;
                        }
                } else {
 
        if (enqueue) {
                ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
-               if (ph2c == NULL) {
+               if (!ph2c) {
                        res = _FAIL;
                        goto exit;
                }
 
                pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
-               if (pdrvextra_cmd_parm == NULL) {
+               if (!pdrvextra_cmd_parm) {
                        kfree(ph2c);
                        res = _FAIL;
                        goto exit;
 
 
        precvpriv->pallocated_frame_buf = rtw_zvmalloc(NR_RECVFRAME * sizeof(struct recv_frame) + RXFRAME_ALIGN_SZ);
 
-       if (precvpriv->pallocated_frame_buf == NULL) {
+       if (!precvpriv->pallocated_frame_buf) {
                res = _FAIL;
                goto exit;
        }
 
                list_del_init(&hdr->list);
                padapter = hdr->adapter;
-               if (padapter != NULL) {
+               if (padapter) {
                        precvpriv = &padapter->recvpriv;
                        if (pfree_recv_queue == &precvpriv->free_recv_queue)
                                precvpriv->free_recvframe_cnt--;
 
        list_add_tail(&(precvframe->list), get_list_head(pfree_recv_queue));
 
-       if (padapter != NULL) {
+       if (padapter) {
                if (pfree_recv_queue == &precvpriv->free_recv_queue)
                                precvpriv->free_recvframe_cnt++;
        }
        list_del_init(&(precvframe->list));
        list_add_tail(&(precvframe->list), get_list_head(queue));
 
-       if (padapter != NULL) {
+       if (padapter) {
                if (queue == &precvpriv->free_recv_queue)
                        precvpriv->free_recvframe_cnt++;
        }
                         prxattrib->ra[0], prxattrib->ra[1], prxattrib->ra[2], prxattrib->ra[3], prxattrib->ra[4], prxattrib->ra[5]));
 
                /* calculate mic code */
-               if (stainfo != NULL) {
+               if (stainfo) {
                        if (IS_MCAST(prxattrib->ra)) {
                                mickey = &psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0];
 
                 adapter->securitypriv.dot11AuthAlgrthm));
 
        if (auth_alg == 2) {
-               if ((psta != NULL) && (psta->ieee8021x_blocked)) {
+               if (psta && psta->ieee8021x_blocked) {
                        /* blocked */
                        /* only accept EAPOL frame */
                        RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:psta->ieee8021x_blocked==1\n"));
        else
                *psta = rtw_get_stainfo(pstapriv, sta_addr); /*  get ap_info */
 
-       if (*psta == NULL) {
+       if (!*psta) {
                RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under sta2sta_data_frame ; drop pkt\n"));
                if (adapter->registrypriv.mp_mode == 1) {
                        if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)
                else
                        *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /*  get ap_info */
 
-               if (*psta == NULL) {
+               if (!*psta) {
                        RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("ap2sta: can't get psta under STATION_MODE ; drop pkt\n"));
                        ret = _FAIL;
                        goto exit;
                memcpy(pattrib->bssid,  mybssid, ETH_ALEN);
 
                *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /*  get sta_info */
-               if (*psta == NULL) {
+               if (!*psta) {
                        RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under MP_MODE ; drop pkt\n"));
                        ret = _FAIL;
                        goto exit;
        } else {
                if (!memcmp(myhwaddr, pattrib->dst, ETH_ALEN) && (!bmcast)) {
                        *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /*  get sta_info */
-                       if (*psta == NULL) {
+                       if (!*psta) {
                                DBG_88E("issue_deauth to the ap =%pM for the reason(7)\n", (pattrib->bssid));
 
                                issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
                }
 
                *psta = rtw_get_stainfo(pstapriv, pattrib->src);
-               if (*psta == NULL) {
+               if (!*psta) {
                        RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under AP_MODE; drop pkt\n"));
                        DBG_88E("issue_deauth to sta=%pM for the reason(7)\n", (pattrib->src));
 
                aid = GetAid(pframe);
                psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
 
-               if ((psta == NULL) || (psta->aid != aid))
+               if (!psta || psta->aid != aid)
                        return _FAIL;
 
                /* for rx pkt statistics */
        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;
        }
                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->rx_data);
                if (type != WIFI_DATA_TYPE) {
                        psta = rtw_get_bcmc_stainfo(padapter);
        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);
 
                }
        }
 
-       if ((prtnframe != NULL) && (prtnframe->attrib.privacy)) {
+       if (prtnframe && prtnframe->attrib.privacy) {
                /* after defrag we must check tkip mic code */
                if (recvframe_chkmic(padapter,  prtnframe) == _FAIL) {
                        RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic(padapter,  prtnframe)==_FAIL\n"));
        rtw_led_control(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;
 
        struct  security_priv   *psecuritypriv = &padapter->securitypriv;
        struct  xmit_priv               *pxmitpriv = &padapter->xmitpriv;
 
-       if (((struct xmit_frame *)pxmitframe)->buf_addr == NULL)
+       if (!((struct xmit_frame *)pxmitframe)->buf_addr)
                return;
 
        hw_hdr_offset = TXDESC_SIZE +
        struct  xmit_priv               *pxmitpriv = &padapter->xmitpriv;
        u32     res = _SUCCESS;
 
-       if (((struct xmit_frame *)pxmitframe)->buf_addr == NULL)
+       if (!((struct xmit_frame *)pxmitframe)->buf_addr)
                return _FAIL;
 
        hw_hdr_offset = TXDESC_SIZE +
                else
                        stainfo = rtw_get_stainfo(&padapter->stapriv, &pattrib->ra[0]);
 
-               if (stainfo != NULL) {
+               if (stainfo) {
                        RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_encrypt: stainfo!= NULL!!!\n"));
 
                        if (IS_MCAST(pattrib->ra))
        /* 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;
 /*     uint    offset = 0; */
        u32 res = _SUCCESS;
 
-       if (((struct xmit_frame *)pxmitframe)->buf_addr == NULL)
+       if (!((struct xmit_frame *)pxmitframe)->buf_addr)
                return _FAIL;
 
        hw_hdr_offset = TXDESC_SIZE +
                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))
        /* 4 start to encrypt each fragment */
        if ((prxattrib->encrypt == _AES_)) {
                stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
-               if (stainfo != NULL) {
+               if (stainfo) {
                        RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_decrypt: stainfo!= NULL!!!\n"));
 
                        if (IS_MCAST(prxattrib->ra)) {
 
 void rtw_mfree_stainfo(struct sta_info *psta)
 {
 
-       if (&psta->lock != NULL)
+       if (&psta->lock)
                 _rtw_spinlock_free(&psta->lock);
 
        _rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
        struct  xmit_priv       *pxmitpriv = &padapter->xmitpriv;
        struct  sta_priv *pstapriv = &padapter->stapriv;
 
-       if (psta == NULL)
+       if (!psta)
                goto exit;
 
        pfree_sta_queue = &pstapriv->free_sta_queue;
        u8 *addr;
        u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-       if (hwaddr == NULL)
+       if (!hwaddr)
                return NULL;
 
        if (IS_MCAST(hwaddr))
 
        psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
 
-       if (psta == NULL) {
+       if (!psta) {
                res = _FAIL;
                RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail"));
                goto exit;
 
        struct mlme_priv                *pmlmepriv = &padapter->mlmepriv;
        struct ht_priv                  *phtpriv = &pmlmepriv->htpriv;
 
-       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)
 
        /* checking SSID */
        p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SSID_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
-       if (p == NULL) {
+       if (!p) {
                DBG_88E("%s marc: cannot find SSID for survey event\n", __func__);
                hidden_ssid = true;
        } else {
        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;
 
        memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, pIE->data, ie_len);
        int status = _SUCCESS;
 
        if (init) {
-               if (pbuddy_padapter == NULL) {
+               if (!pbuddy_padapter) {
                        pbuddy_padapter = adapter;
                        DBG_88E("%s(): pbuddy_padapter == NULL, Set pbuddy_padapter\n", __func__);
                } else {
 
 
        pxmitpriv->pallocated_frame_buf = rtw_zvmalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4);
 
-       if (pxmitpriv->pallocated_frame_buf  == NULL) {
+       if (!pxmitpriv->pallocated_frame_buf) {
                pxmitpriv->pxmit_frame_buf = NULL;
                RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_frame fail!\n"));
                res = _FAIL;
 
        pxmitpriv->pallocated_xmitbuf = rtw_zvmalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
 
-       if (pxmitpriv->pallocated_xmitbuf  == NULL) {
+       if (!pxmitpriv->pallocated_xmitbuf) {
                RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_buf fail!\n"));
                res = _FAIL;
                goto exit;
 
        pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
 
-       if (pxmitpriv->pallocated_xmit_extbuf  == NULL) {
+       if (!pxmitpriv->pallocated_xmit_extbuf) {
                RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_extbuf fail!\n"));
                res = _FAIL;
                goto exit;
 
        rtw_mfree_xmit_priv_lock(pxmitpriv);
 
-       if (pxmitpriv->pxmit_frame_buf == NULL)
+       if (!pxmitpriv->pxmit_frame_buf)
                return;
 
        for (i = 0; i < NR_XMITFRAME; i++) {
                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) {
+       if (!pxmitframe->buf_addr) {
                DBG_88E("==> %s buf_addr == NULL\n", __func__);
                return _FAIL;
        }
 
                /* adding icv, if necessary... */
                if (pattrib->iv_len) {
-                       if (psta != NULL) {
+                       if (psta) {
                                switch (pattrib->encrypt) {
                                case _WEP40_:
                                case _WEP104_:
        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);
                list_del_init(&(pxmitbuf->list));
        }
 
-       if (pxmitbuf !=  NULL) {
+       if (pxmitbuf) {
                pxmitpriv->free_xmit_extbuf_cnt--;
 
                pxmitbuf->priv_data = NULL;
        struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue;
        unsigned long flags;
 
-       if (pxmitbuf == NULL)
+       if (!pxmitbuf)
                return _FAIL;
 
        spin_lock_irqsave(&pfree_queue->lock, flags);
                list_del_init(&(pxmitbuf->list));
        }
 
-       if (pxmitbuf !=  NULL) {
+       if (pxmitbuf) {
                pxmitpriv->free_xmitbuf_cnt--;
                pxmitbuf->priv_data = NULL;
                if (pxmitbuf->sctx) {
        struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
        unsigned long flags;
 
-       if (pxmitbuf == NULL)
+       if (!pxmitbuf)
                return _FAIL;
 
        if (pxmitbuf->sctx) {
                list_del_init(&(pxframe->list));
        }
 
-       if (pxframe !=  NULL) { /* default value setting */
+       if (pxframe) { /* default value setting */
                pxmitpriv->free_xmitframe_cnt--;
 
                RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe():free_xmitframe_cnt=%d\n", pxmitpriv->free_xmitframe_cnt));
        struct adapter *padapter = pxmitpriv->adapter;
        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;
        }
                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"));
                                }
 
                                newskb = skb_copy(skb, GFP_ATOMIC);
-                               if (newskb == NULL) {
+                               if (!newskb) {
                                        DEBUG_ERR("TX DROP: skb_copy fail!\n");
                                        return -1;
                                }
        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) {