[PATCH 08/10] staging: rtl8723bs: rewrite comparisons to null

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fix the following post-commit hook checkpatch issues:

CHECK: Comparison to NULL could be written "!pwep"
147: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:442:
+			if (pwep == NULL)

CHECK: Comparison to NULL could be written "!skb"
226: FILE: drivers/staging/rtl8723bs/os_dep/recv_linux.c:204:
+	if (skb == NULL)

CHECK: Comparison to NULL could be written "!dvobj"
275: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:398:
+	if (dvobj == NULL)

Suggested-by: Joe Perches <joe@xxxxxxxxxxx>
Signed-off-by: Fabio Aiuto <fabioaiuto83@xxxxxxxxx>
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +-
 drivers/staging/rtl8723bs/os_dep/recv_linux.c  | 2 +-
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 03360af0645d..297287cff5be 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -439,7 +439,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
 			wep_key_len = wep_key_len <= 5 ? 5 : 13;
 			wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
 			pwep = kzalloc(wep_total_len, GFP_KERNEL);
-			if (pwep == NULL)
+			if (!pwep)
 				goto exit;
 
 			pwep->KeyLength = wep_key_len;
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 63a7e7fe2bb5..975aceb7b45b 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -201,7 +201,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
 	pfree_recv_queue = &(precvpriv->free_recv_queue);
 
 	skb = precv_frame->u.hdr.pkt;
-	if (skb == NULL)
+	if (!skb)
 		goto _recv_indicatepkt_drop;
 
 	skb->data = precv_frame->u.hdr.rx_data;
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index f8e1d15f54ef..deba03ad6c6e 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -395,7 +395,7 @@ static int rtw_drv_init(
 	struct dvobj_priv *dvobj;
 
 	dvobj = sdio_dvobj_init(func);
-	if (dvobj == NULL)
+	if (!dvobj)
 		goto exit;
 
 	if1 = rtw_sdio_if1_init(dvobj, id);
-- 
2.20.1





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux