struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
 
        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;
                }
        }
        /* 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.ie_length - 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 ieee80211_ht_cap));
 
                        /* to disable 40M Hz support while gd_bw_40MHz_en = 0 */
        struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
 
        /* da == NULL, assume it's null data for sta to ap*/
-       if (da == NULL)
+       if (!da)
                da = pnetwork->MacAddress;
 
        do {
        struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
 
        /* da == NULL, assume it's null data for sta to ap*/
-       if (da == NULL)
+       if (!da)
                da = pnetwork->MacAddress;
 
        do {
        __le16 le_tmp;
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL)
+       if (!pmgntframe)
                goto exit;
 
        /* 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->ie_length - _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 rate info... */
        i = 0;
        p = rtw_get_ie(bssid->ies + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->ie_length - 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;
 
                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)
                        p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_, _CHLGETXT_IE_, &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_, &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);
 
        /*  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;
                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) { */
                            ((o->bw == BW40MINUS) || (o->bw == BW40PLUS)))
                                continue;
 
-                       if (reg == NULL) {
+                       if (!reg) {
                                reg = &channel_list->reg_class[cla];
                                cla++;
                                reg->reg_class = o->op_class;
 
        ptxBeacon_parm = kmemdup(&pmlmeinfo->network,
                                sizeof(struct wlan_bssid_ex), GFP_ATOMIC);
-       if (ptxBeacon_parm == NULL) {
+       if (!ptxBeacon_parm) {
                kfree(ph2c);
                res = _FAIL;
                goto exit;