]> git.karo-electronics.de Git - linux-beck.git/commit
Staging: rtl8723au: Clean up tests if NULL returned on failure
authorBhumika Goyal <bhumirks@gmail.com>
Wed, 24 Feb 2016 10:23:57 +0000 (15:53 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Mar 2016 03:44:34 +0000 (19:44 -0800)
commit28f5caa1679e18d4718f5ca6c6aaf95cbfc7afb5
tree5132256c391dd4bf068b950597b7dd8f77e92035
parent4e7c855eae56f9723b92d058505a9d87a5e9c76f
Staging: rtl8723au: Clean up tests if NULL returned on failure

Some functions like kmalloc/usb_alloc_urb 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/rtl8723au/hal/rtl8723a_hal_init.c
drivers/staging/rtl8723au/os_dep/xmit_linux.c