diff options
author | Gargi Sharma <gs051095@gmail.com> | 2017-02-24 01:10:51 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-06 09:17:01 +0100 |
commit | c01496a7d2abe8462e10c9a536b5e0c46a460d06 (patch) | |
tree | 16becf24b869c42bcbe99f600fc04034c6930663 /drivers/staging/rtl8188eu/os_dep | |
parent | 24542a004bdadd0f8e724b7da1c068f557d390c6 (diff) | |
download | op-kernel-dev-c01496a7d2abe8462e10c9a536b5e0c46a460d06.zip op-kernel-dev-c01496a7d2abe8462e10c9a536b5e0c46a460d06.tar.gz |
staging: rtl8188eu: replace explicit NULL comparison
Replace explicit NULL comparison with ! operator to
simplify code.
Found with Coccinelle script:
@@
expression ptr;
position p;
statement s0;
@@
ptr@p =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\|
alloc_netdev\|dev_alloc_skb\)(...)
... when != ptr
if (
(
+ !
ptr
- == NULL
)
) s0
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu/os_dep')
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c index e097c61..8bf8248 100644 --- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c @@ -72,7 +72,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb for (i = 0; i < 8; i++) { pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL); - if (pxmitbuf->pxmit_urb[i] == NULL) { + if (!pxmitbuf->pxmit_urb[i]) { DBG_88E("pxmitbuf->pxmit_urb[i]==NULL"); return _FAIL; } |