Commit 41452327 authored by Vatsala Narang's avatar Vatsala Narang Committed by Greg Kroah-Hartman

staging: rtl8723bs: core: Replace NULL comparisons.

Replace NULL comparisons in the file to get rid of checkpatch warning.
Signed-off-by: default avatarVatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 68106250
...@@ -381,7 +381,7 @@ static void init_channel_list(struct adapter *padapter, RT_CHANNEL_INFO *channel ...@@ -381,7 +381,7 @@ static void init_channel_list(struct adapter *padapter, RT_CHANNEL_INFO *channel
((BW40MINUS == o->bw) || (BW40PLUS == o->bw))) ((BW40MINUS == o->bw) || (BW40PLUS == o->bw)))
continue; continue;
if (reg == NULL) { if (!reg) {
reg = &channel_list->reg_class[cla]; reg = &channel_list->reg_class[cla];
cla++; cla++;
reg->reg_class = o->op_class; reg->reg_class = o->op_class;
...@@ -659,7 +659,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -659,7 +659,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
/* allocate a new one */ /* allocate a new one */
DBG_871X("going to alloc stainfo for rc ="MAC_FMT"\n", MAC_ARG(get_sa(pframe))); DBG_871X("going to alloc stainfo for rc ="MAC_FMT"\n", MAC_ARG(get_sa(pframe)));
psta = rtw_alloc_stainfo(pstapriv, get_sa(pframe)); psta = rtw_alloc_stainfo(pstapriv, get_sa(pframe));
if (psta == NULL) { if (!psta) {
/* TODO: */ /* TODO: */
DBG_871X(" Exceed the upper limit of supported clients...\n"); DBG_871X(" Exceed the upper limit of supported clients...\n");
return _SUCCESS; return _SUCCESS;
...@@ -1217,7 +1217,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -1217,7 +1217,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
} }
pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
if (pstat == NULL) { if (!pstat) {
status = _RSON_CLS2_; status = _RSON_CLS2_;
goto asoc_class2_error; goto asoc_class2_error;
} }
...@@ -1377,7 +1377,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) ...@@ -1377,7 +1377,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
goto OnAssocReqFail; goto OnAssocReqFail;
pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS); pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS);
if (wpa_ie == NULL) { if (!wpa_ie) {
if (elems.wps_ie) { if (elems.wps_ie) {
DBG_871X("STA included WPS IE in " DBG_871X("STA included WPS IE in "
"(Re)Association Request - assume WPS is " "(Re)Association Request - assume WPS is "
...@@ -1943,7 +1943,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra ...@@ -1943,7 +1943,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra
addr = GetAddr2Ptr(pframe); addr = GetAddr2Ptr(pframe);
psta = rtw_get_stainfo(pstapriv, addr); psta = rtw_get_stainfo(pstapriv, addr);
if (psta == NULL) if (!psta)
return _SUCCESS; return _SUCCESS;
frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
...@@ -2462,7 +2462,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) ...@@ -2462,7 +2462,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms)
/* DBG_871X("%s\n", __func__); */ /* DBG_871X("%s\n", __func__); */
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL) { if (!pmgntframe) {
DBG_871X("%s, alloc mgnt frame fail\n", __func__); DBG_871X("%s, alloc mgnt frame fail\n", __func__);
return; return;
} }
...@@ -2843,7 +2843,7 @@ static int _issue_probereq(struct adapter *padapter, ...@@ -2843,7 +2843,7 @@ static int _issue_probereq(struct adapter *padapter,
RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+issue_probereq\n")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+issue_probereq\n"));
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL) if (!pmgntframe)
goto exit; goto exit;
/* update attribute */ /* update attribute */
...@@ -3909,7 +3909,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch ...@@ -3909,7 +3909,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
DBG_871X("%s, category =%d, action =%d, status =%d\n", __func__, category, action, status); DBG_871X("%s, category =%d, action =%d, status =%d\n", __func__, category, action, status);
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL) if (!pmgntframe)
return; return;
/* update attribute */ /* update attribute */
...@@ -5033,12 +5033,12 @@ void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame ...@@ -5033,12 +5033,12 @@ void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame
pcmdpriv = &padapter->cmdpriv; pcmdpriv = &padapter->cmdpriv;
pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd_obj == NULL) if (!pcmd_obj)
return; return;
cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header));
pevtcmd = rtw_zmalloc(cmdsz); pevtcmd = rtw_zmalloc(cmdsz);
if (pevtcmd == NULL) { if (!pevtcmd) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
} }
...@@ -5086,12 +5086,12 @@ void report_surveydone_event(struct adapter *padapter) ...@@ -5086,12 +5086,12 @@ void report_surveydone_event(struct adapter *padapter)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd_obj == NULL) if (!pcmd_obj)
return; return;
cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header));
pevtcmd = rtw_zmalloc(cmdsz); pevtcmd = rtw_zmalloc(cmdsz);
if (pevtcmd == NULL) { if (!pevtcmd) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
} }
...@@ -5133,12 +5133,12 @@ void report_join_res(struct adapter *padapter, int res) ...@@ -5133,12 +5133,12 @@ void report_join_res(struct adapter *padapter, int res)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd_obj == NULL) if (!pcmd_obj)
return; return;
cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header));
pevtcmd = rtw_zmalloc(cmdsz); pevtcmd = rtw_zmalloc(cmdsz);
if (pevtcmd == NULL) { if (!pevtcmd) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
} }
...@@ -5184,12 +5184,12 @@ void report_wmm_edca_update(struct adapter *padapter) ...@@ -5184,12 +5184,12 @@ void report_wmm_edca_update(struct adapter *padapter)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd_obj == NULL) if (!pcmd_obj)
return; return;
cmdsz = (sizeof(struct wmm_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct wmm_event) + sizeof(struct C2HEvent_Header));
pevtcmd = rtw_zmalloc(cmdsz); pevtcmd = rtw_zmalloc(cmdsz);
if (pevtcmd == NULL) { if (!pevtcmd) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
} }
......
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