Staging: rtl8188eu: core: Remove explicit NULL comparison
PATCH v2 5/16 Staging: rtl8188eu: core: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
---
Changes in v2-
No change
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +3 -3
@@ -273,7 +273,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)struct sta_priv *pstapriv = &padapter->stapriv; -if (psta ==NULL ) +if (!psta) goto exit; pfree_sta_queue = &pstapriv->free_sta_queue;
@@ -433,7 +433,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)u8 bc_addr[ETH_ALEN ] = {0xff ,0xff ,0xff ,0xff ,0xff ,0xff }; -if (hwaddr ==NULL ) +if (!hwaddr)return NULL ;if (IS_MCAST (hwaddr))
@@ -473,7 +473,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter) 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;
Signature · 1 line
2.1.4
PATCH v2 6/16 Staging: rtl8188eu: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
---
Change in v2-
No change.
drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +2 -2
@@ -467,7 +467,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)DBG_88E ("%s\n" , __func__); ReservedPagePacket =kzalloc (1000 ,GFP_KERNEL ); -if (ReservedPagePacket ==NULL ) { +if (!ReservedPagePacket) {DBG_88E ("%s: alloc ReservedPagePacket fail!\n" , __func__);return ; }
@@ -537,7 +537,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) TotalPacketLen = BufIndex + QosNullLength; pmgntframe =alloc_mgtxmitframe (pxmitpriv); -if (pmgntframe ==NULL ) +if (!pmgntframe) goto exit;/* update attribute */
Signature · 1 line
2.1.4
PATCH v2 11/16 Staging: rtl8188eu: hal: Remove explicit NULL comparison
In reply to Shraddha BarkeRemove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
---
Change in v2-
No change
drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +1 -1
@@ -43,7 +43,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter) precvpriv->pallocated_recv_buf =kcalloc (NR_RECVBUFF ,sizeof (struct recv_buf ),GFP_KERNEL ); -if (precvpriv->pallocated_recv_buf ==NULL ) { +if (!precvpriv->pallocated_recv_buf) { res = _FAIL;RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n" ));
Signature · 1 line
2.1.4
PATCH v2 12/16 Staging: rtl8188eu: hal: Hal8188ERateAdaptive.c: Remove explicit NULL comparison
In reply to Shraddha BarkeRemove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
---
Change in v2-
No change
drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c +7 -7
@@ -127,7 +127,7 @@ static int odm_RateDown_8188E(struct odm_dm_struct *dm_odm,ODM_RT_TRACE (dm_odm,ODM_COMP_RATE_ADAPTIVE ,ODM_DBG_TRACE , ("=====>odm_RateDown_8188E()\n" )); -if (NULL == pRaInfo) { +if (!pRaInfo) {ODM_RT_TRACE (dm_odm,ODM_COMP_RATE_ADAPTIVE ,ODM_DBG_LOUD , ("odm_RateDown_8188E(): pRaInfo is NULL\n" ));return -1 ;
@@ -193,7 +193,7 @@ static int odm_RateUp_8188E(ODM_RT_TRACE (dm_odm,ODM_COMP_RATE_ADAPTIVE ,ODM_DBG_TRACE , ("=====>odm_RateUp_8188E()\n" )); -if (NULL == pRaInfo) { +if (!pRaInfo) {ODM_RT_TRACE (dm_odm,ODM_COMP_RATE_ADAPTIVE ,ODM_DBG_LOUD , ("odm_RateUp_8188E(): pRaInfo is NULL\n" ));return -1 ;
@@ -624,7 +624,7 @@ int ODM_RAInfo_Init_all(struct odm_dm_struct *dm_odm)u8 ODM_RA_GetShortGI_8188E (struct odm_dm_struct *dm_odm,u8 macid) { -if ((NULL == dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM )) +if ((!dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM ))return 0 ;ODM_RT_TRACE (dm_odm,ODM_COMP_RATE_ADAPTIVE ,ODM_DBG_TRACE , ("macid =%d SGI =%d\n" , macid, dm_odm->RAInfo[macid].RateSGI));
@@ -635,7 +635,7 @@ u8 ODM_RA_GetDecisionRate_8188E(struct odm_dm_struct *dm_odm, u8 macid) {u8 DecisionRate =0 ; -if ((NULL == dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM )) +if ((!dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM ))return 0 ; DecisionRate = dm_odm->RAInfo[macid].DecisionRate; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
@@ -647,7 +647,7 @@ u8 ODM_RA_GetHwPwrStatus_8188E(struct odm_dm_struct *dm_odm, u8 macid) {u8 PTStage =5 ; -if ((NULL == dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM )) +if ((!dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM ))return 0 ; PTStage = dm_odm->RAInfo[macid].PTStage; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
@@ -659,7 +659,7 @@ void ODM_RA_UpdateRateInfo_8188E(struct odm_dm_struct *dm_odm, u8 macid, u8 Rate {struct odm_ra_info *pRaInfo =NULL ; -if ((NULL == dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM )) +if ((!dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM ))return ; ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("macid =%d RateID = 0x%x RateMask = 0x%x SGIEnable =%d\n",
@@ -676,7 +676,7 @@ void ODM_RA_SetRSSI_8188E(struct odm_dm_struct *dm_odm, u8 macid, u8 Rssi) {struct odm_ra_info *pRaInfo =NULL ; -if ((NULL == dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM )) +if ((!dm_odm) || (macid >=ASSOCIATE_ENTRY_NUM ))return ;ODM_RT_TRACE (dm_odm,ODM_COMP_RATE_ADAPTIVE ,ODM_DBG_TRACE , (" macid =%d Rssi =%d\n" , macid, Rssi));
Signature · 1 line
2.1.4
PATCH v2 13/16 Staging: rtl8188eu: hal: rtl8188eu_xmit.c: Remove explicit NULL comparison
In reply to Shraddha BarkeRemove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
---
Changes in v2-
No change
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +1 -1
@@ -649,7 +649,7 @@ static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe) goto enqueue; pxmitbuf =rtw_alloc_xmitbuf (pxmitpriv); -if (pxmitbuf ==NULL ) +if (!pxmitbuf) goto enqueue;spin_unlock_bh (&pxmitpriv->lock);
Signature · 1 line
2.1.4
PATCH v2 14/16 Staging: rtl8188eu: os_dep: recv_linux.c: Remove explicit NULL comparison
In reply to Shraddha BarkeRemove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
---
Change in v2-
No change
drivers/staging/rtl8188eu/os_dep/recv_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/os_dep/recv_linux.c +1 -1
@@ -94,7 +94,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, pfree_recv_queue = &(precvpriv->free_recv_queue); skb = precv_frame->pkt; -if (skb ==NULL ) { +if (!skb) {RT_TRACE (_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong!!!!\n" )); goto _recv_indicatepkt_drop;
Signature · 1 line
2.1.4
PATCH v2 15/16 Staging: rtl8188eu: os_dep: mlme_linux.c: Remove explicit NULL comparison
In reply to Shraddha BarkeRemove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
---
Change in v2-
No changes
drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/os_dep/mlme_linux.c +2 -2
@@ -152,7 +152,7 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *pstunion iwreq_data wrqu;struct sta_priv *pstapriv = &padapter->stapriv; -if (psta ==NULL ) +if (!psta)return ;if (psta->aid >NUM_STA )
@@ -176,7 +176,7 @@ void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *union iwreq_data wrqu;struct sta_priv *pstapriv = &padapter->stapriv; -if (psta ==NULL ) +if (!psta)return ;if (psta->aid >NUM_STA )
Signature · 1 line
2.1.4
PATCH v2 16/16 Staging: rtl8188eu: os_dep: osdep_service.c: Remove explicit NULL comparison
In reply to Shraddha BarkeRemove explicit NULL comparison and write it in its simpler form. Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
---
Change in v2-
No change
drivers/staging/rtl8188eu/os_dep/osdep_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/os_dep/osdep_service.c +1 -1
@@ -52,7 +52,7 @@ void *rtw_malloc2d(int h, int w, int size)int j;void **a =kzalloc (h*sizeof (void *) + h*w*size,GFP_KERNEL ); -if (a ==NULL ) { +if (!a) {pr_info ("%s: alloc memory fail!\n" , __func__);return NULL ; }
Signature · 1 line
2.1.4