[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190501103547.10095-1-vatsalanarang@gmail.com>
Date: Wed, 1 May 2019 16:05:47 +0530
From: Vatsala Narang <vatsalanarang@...il.com>
To: gregkh@...uxfoundation.org
Cc: hadess@...ess.net, hdegoede@...hat.com, Larry.Finger@...inger.net,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
julia.lawall@...6.fr, Vatsala Narang <vatsalanarang@...il.com>
Subject: [PATCH] staging: rtl8723bs: core: Use !x in place of NULL comparison.
Avoid NULL comparison, compare using boolean operator.
Issue found using coccinelle.
Signed-off-by: Vatsala Narang <vatsalanarang@...il.com>
---
drivers/staging/rtl8723bs/core/rtw_io.c | 2 +-
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
index d341069097e2..a92bc19b196a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_io.c
+++ b/drivers/staging/rtl8723bs/core/rtw_io.c
@@ -156,7 +156,7 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
struct io_priv *piopriv = &padapter->iopriv;
struct intf_hdl *pintf = &piopriv->intf;
- if (set_intf_ops == NULL)
+ if (!set_intf_ops)
return _FAIL;
piopriv->padapter = padapter;
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index 67b8840ee2fd..bdc52d8d5625 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -316,7 +316,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
struct sta_priv *pstapriv = &padapter->stapriv;
struct hw_xmit *phwxmit;
- if (psta == NULL)
+ if (!psta)
goto exit;
@@ -520,7 +520,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
u8 *addr;
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- if (hwaddr == NULL)
+ if (!hwaddr)
return NULL;
if (IS_MCAST(hwaddr))
@@ -565,7 +565,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.17.1
Powered by blists - more mailing lists