[PATCH 15/25] staging: rtl8723bs: fix comparison to null
From: Fabio Aiuto
Date: Sat Apr 10 2021 - 10:21:53 EST
fix following post-commit hook checkpatch issues:
CHECK: Comparison to NULL could be written "!pmlmepriv->wps_probe_req_ie"
348: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:1319:
+ if (pmlmepriv->wps_probe_req_ie == NULL)
CHECK: Comparison to NULL could be written "!dvobj"
459: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:184:
+ if (dvobj == NULL)
CHECK: Comparison to NULL could be written "!padapter"
470: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:231:
+ if (padapter == NULL)
CHECK: Comparison to NULL could be written "!padapter"
481: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:240:
+ if (padapter == NULL)
CHECK: Comparison to NULL could be written "!padapter"
492: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:256:
+ if (padapter == NULL)
Signed-off-by: Fabio Aiuto <fabioaiuto83@xxxxxxxxx>
---
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +-
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index c85fd9e9e394..601a16074ee3 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1316,7 +1316,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct adapter *padapter, char *b
}
pmlmepriv->wps_probe_req_ie = rtw_malloc(wps_ielen);
- if (pmlmepriv->wps_probe_req_ie == NULL)
+ if (!pmlmepriv->wps_probe_req_ie)
return -EINVAL;
memcpy(pmlmepriv->wps_probe_req_ie, wps_ie, wps_ielen);
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 34c5eff02b2f..a8ef95ab14da 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -181,7 +181,7 @@ static struct dvobj_priv *sdio_dvobj_init(struct sdio_func *func)
struct sdio_data *psdio;
dvobj = devobj_init();
- if (dvobj == NULL)
+ if (!dvobj)
goto exit;
sdio_set_drvdata(func, dvobj);
@@ -228,7 +228,7 @@ void rtw_set_hal_ops(struct adapter *padapter)
static void sd_intf_start(struct adapter *padapter)
{
- if (padapter == NULL)
+ if (!padapter)
return;
/* hal dep */
@@ -237,7 +237,7 @@ static void sd_intf_start(struct adapter *padapter)
static void sd_intf_stop(struct adapter *padapter)
{
- if (padapter == NULL)
+ if (!padapter)
return;
/* hal dep */
@@ -253,7 +253,7 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
struct sdio_data *psdio = &dvobj->intf_data;
padapter = vzalloc(sizeof(*padapter));
- if (padapter == NULL)
+ if (!padapter)
goto exit;
padapter->dvobj = dvobj;
--
2.20.1