mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 05/16] Staging: rtl8188eu: core: Remove explicit NULL comparison
@ 2015-09-11  5:10 Shraddha Barke
  2015-09-11  5:10 ` [PATCH v2 06/16] Staging: rtl8188eu: " Shraddha Barke
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Shraddha Barke @ 2015-09-11  5:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sudip Mukherjee, Andrzej Pietrasiewicz, Julia Lawall
  Cc: linux-kernel, Shraddha Barke

Remove explicit NULL comparison and write it in its simpler form.
Replacement done with coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2-
 No change

 drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
index b340e4a..497fb06 100644
--- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
@@ -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;
-- 
2.1.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-09-11  5:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-11  5:10 [PATCH v2 05/16] Staging: rtl8188eu: core: Remove explicit NULL comparison Shraddha Barke
2015-09-11  5:10 ` [PATCH v2 06/16] Staging: rtl8188eu: " Shraddha Barke
2015-09-11  5:10 ` [PATCH v2 11/16] Staging: rtl8188eu: hal: " Shraddha Barke
2015-09-11  5:10 ` [PATCH v2 12/16] Staging: rtl8188eu: hal: Hal8188ERateAdaptive.c: " Shraddha Barke
2015-09-11  5:10 ` [PATCH v2 13/16] Staging: rtl8188eu: hal: rtl8188eu_xmit.c: " Shraddha Barke
2015-09-11  5:10 ` [PATCH v2 14/16] Staging: rtl8188eu: os_dep: recv_linux.c: " Shraddha Barke
2015-09-11  5:10 ` [PATCH v2 15/16] Staging: rtl8188eu: os_dep: mlme_linux.c: " Shraddha Barke
2015-09-11  5:10 ` [PATCH v2 16/16] Staging: rtl8188eu: os_dep: osdep_service.c: " Shraddha Barke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®