diff options
author | Puranjay Mohan <puranjay12@gmail.com> | 2019-05-21 20:02:25 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-22 14:32:40 +0200 |
commit | 67436a1ecc72387feabde8c07a347261f4f14ca8 (patch) | |
tree | b2639b8a1d2027570cd0ebf3b335a278f0926303 /drivers/staging/rtl8188eu | |
parent | fd078b420961633713032d0bfdf448281bd33e3b (diff) | |
download | linux-67436a1ecc72387feabde8c07a347261f4f14ca8.tar.bz2 |
Staging: rtl8188eu: core: Use !x in place of NULL comparisons
Change (x == NULL) to !x and (x != NULL) to x, to fix
following checkpatch.pl warnings:
CHECK: Comparison to NULL could be written "!x".
Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_recv.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 087f6c9a5826..9caf7041ad60 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -450,7 +450,7 @@ static struct recv_frame *portctrl(struct adapter *adapter, memcpy(&be_tmp, ptr, 2); ether_type = ntohs(be_tmp); - if ((psta != NULL) && (psta->ieee8021x_blocked)) { + if (psta && (psta->ieee8021x_blocked)) { /* blocked */ /* only accept EAPOL frame */ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########%s:psta->ieee8021x_blocked==1\n", __func__)); @@ -700,7 +700,7 @@ static int sta2sta_data_frame(struct adapter *adapter, 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 %s ; drop pkt\n", __func__)); ret = _FAIL; goto exit; @@ -764,7 +764,7 @@ static int ap2sta_data_frame( 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; @@ -786,7 +786,7 @@ static int ap2sta_data_frame( } else { if (!memcmp(myhwaddr, pattrib->dst, ETH_ALEN) && !mcast) { *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); @@ -820,7 +820,7 @@ static int sta2ap_data_frame(struct adapter *adapter, } *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)); @@ -883,7 +883,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter, 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 */ @@ -1479,7 +1479,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, } } - 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")); |