Commit e31447f9 authored by Gargi Sharma's avatar Gargi Sharma Committed by Greg Kroah-Hartman

staging: rtl8188eu: Replace x==NULL by !x

Replace x==NULL by !x, to fix the checkpatch issue
comparsion with NULL could be written as !x.
Signed-off-by: default avatarGargi Sharma <gs051095@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f4c04b8f
...@@ -55,7 +55,7 @@ int rtw_init_mlme_priv(struct adapter *padapter) ...@@ -55,7 +55,7 @@ int rtw_init_mlme_priv(struct adapter *padapter)
pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network))); pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network)));
if (pbuf == NULL) { if (!pbuf) {
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
...@@ -147,7 +147,7 @@ static void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network * ...@@ -147,7 +147,7 @@ static void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *
u32 lifetime = SCANQUEUE_LIFETIME; u32 lifetime = SCANQUEUE_LIFETIME;
struct __queue *free_queue = &(pmlmepriv->free_bss_pool); struct __queue *free_queue = &(pmlmepriv->free_bss_pool);
if (pnetwork == NULL) if (!pnetwork)
return; return;
if (pnetwork->fixed) if (pnetwork->fixed)
...@@ -171,7 +171,7 @@ void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network * ...@@ -171,7 +171,7 @@ void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *
{ {
struct __queue *free_queue = &(pmlmepriv->free_bss_pool); struct __queue *free_queue = &(pmlmepriv->free_bss_pool);
if (pnetwork == NULL) if (!pnetwork)
return; return;
if (pnetwork->fixed) if (pnetwork->fixed)
return; return;
...@@ -346,7 +346,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue) ...@@ -346,7 +346,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
pwlan = container_of(plist, struct wlan_network, list); pwlan = container_of(plist, struct wlan_network, list);
if (!pwlan->fixed) { 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; oldest = pwlan;
} }
} }
...@@ -457,7 +457,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t ...@@ -457,7 +457,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
pnetwork = rtw_alloc_network(pmlmepriv); /* will update scan_time */ 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")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n\nsomething wrong here\n\n\n"));
goto exit; goto exit;
} }
...@@ -526,7 +526,7 @@ static int rtw_is_desired_network(struct adapter *adapter, struct wlan_network * ...@@ -526,7 +526,7 @@ static int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *
privacy = pnetwork->network.Privacy; privacy = pnetwork->network.Privacy;
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { 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; return true;
else else
return false; return false;
...@@ -876,7 +876,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str ...@@ -876,7 +876,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
psta = rtw_get_stainfo(pstapriv, pnetwork->network.MacAddress); psta = rtw_get_stainfo(pstapriv, pnetwork->network.MacAddress);
if (psta == NULL) if (!psta)
psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress); psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress);
if (psta) { /* update ptarget_sta */ if (psta) { /* update ptarget_sta */
...@@ -1074,7 +1074,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) ...@@ -1074,7 +1074,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
/* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */ /* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork); 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")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n"));
spin_unlock_bh(&pmlmepriv->scanned_queue.lock); spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
goto ignore_joinbss_callback; goto ignore_joinbss_callback;
...@@ -1144,7 +1144,7 @@ static u8 search_max_mac_id(struct adapter *padapter) ...@@ -1144,7 +1144,7 @@ static u8 search_max_mac_id(struct adapter *padapter)
#if defined(CONFIG_88EU_AP_MODE) #if defined(CONFIG_88EU_AP_MODE)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
for (aid = (pstapriv->max_num_sta); aid > 0; aid--) { for (aid = (pstapriv->max_num_sta); aid > 0; aid--) {
if (pstapriv->sta_aid[aid-1] != NULL) if (!pstapriv->sta_aid[aid-1])
break; break;
} }
mac_id = aid + 1; mac_id = aid + 1;
...@@ -1165,7 +1165,7 @@ void rtw_stassoc_hw_rpt(struct adapter *adapter, struct sta_info *psta) ...@@ -1165,7 +1165,7 @@ void rtw_stassoc_hw_rpt(struct adapter *adapter, struct sta_info *psta)
u16 media_status; u16 media_status;
u8 macid; u8 macid;
if (psta == NULL) if (!psta)
return; return;
macid = search_max_mac_id(adapter); macid = search_max_mac_id(adapter);
...@@ -1197,13 +1197,13 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) ...@@ -1197,13 +1197,13 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
#endif #endif
/* for AD-HOC mode */ /* for AD-HOC mode */
psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr); psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
if (psta != NULL) { if (!psta) {
/* the sta have been in sta_info_queue => do nothing */ /* 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")); 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) */ 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); 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")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't alloc sta_info when rtw_stassoc_event_callback\n"));
return; return;
} }
...@@ -1520,7 +1520,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) ...@@ -1520,7 +1520,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
pmlmepriv->pscanned = pmlmepriv->pscanned->next; pmlmepriv->pscanned = pmlmepriv->pscanned->next;
rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork); rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
} }
if (candidate == NULL) { if (!candidate) {
DBG_88E("%s: return _FAIL(candidate==NULL)\n", __func__); DBG_88E("%s: return _FAIL(candidate==NULL)\n", __func__);
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
...@@ -2064,7 +2064,7 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr ...@@ -2064,7 +2064,7 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr
else else
psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
if (psta == NULL) if (!psta)
return; return;
phtpriv = &psta->htpriv; phtpriv = &psta->htpriv;
...@@ -2096,7 +2096,7 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network) ...@@ -2096,7 +2096,7 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
struct wlan_network *pnetwork; struct wlan_network *pnetwork;
if (tgt_network != NULL) if (!tgt_network)
pnetwork = tgt_network; pnetwork = tgt_network;
else else
pnetwork = &pmlmepriv->cur_network; pnetwork = &pmlmepriv->cur_network;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment