]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: rtl8188eu: os_dep: Remove useless return variables
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Fri, 26 Feb 2016 09:40:18 +0000 (15:10 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2016 06:09:09 +0000 (22:09 -0800)
This patch removes unnecessary return variables and compresses the
return logic.
The coccinelle script that finds and fixes this issue is:
@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/os_dep/osdep_service.c

index d87b54711c0d52d3eebfd563b798c2733d99c572..5a90ef6381a1a6a59ddfb4669c9c4107e29287ba 100644 (file)
@@ -41,10 +41,7 @@ inline int RTW_STATUS_CODE(int error_code)
 
 u8 *_rtw_malloc(u32 sz)
 {
-       u8      *pbuf = NULL;
-
-       pbuf = kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
-       return pbuf;
+       return kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
 }
 
 void *rtw_malloc2d(int h, int w, int size)