Staging: rtl8712: Clean up tests if NULL returned on failure
authorBhumika Goyal <bhumirks@gmail.com>
Wed, 24 Feb 2016 10:39:31 +0000 (16:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2016 06:09:09 +0000 (22:09 -0800)
commit9155c92463ecbb55c6eca6145e139869e9ba1546
tree91e983d48b730fbdd2a26477e452bc04701fa927
parentbb106dc0e227f7a04d9034cad25913b3c21146a8
Staging: rtl8712: Clean up tests if NULL returned on failure

Some functions like kmalloc/usb_alloc_urb/kmalloc_array returns NULL as
their return value on failure. !x is generally preferred over x==NULL
or NULL==x so make use of !x if the value returned on failure
by these functions is NULL.
Done using coccinelle:

@@
expression e;
statement S;
@@
e = \(kmalloc\|devm_kzalloc\|kmalloc_array
     \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...);
- if(e==NULL)
+ if(!e)
  S

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/recv_linux.c
drivers/staging/rtl8712/rtl871x_io.c
drivers/staging/rtl8712/rtl871x_mlme.c
drivers/staging/rtl8712/rtl871x_mp.c
drivers/staging/rtl8712/rtl871x_sta_mgt.c
drivers/staging/rtl8712/rtl871x_xmit.c