staging: rtl8188eu: rearrange code
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Fri, 7 Aug 2015 10:36:30 +0000 (16:06 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 22:17:59 +0000 (15:17 -0700)
Re-arrange the code to directly return success or failure, thus removing
the variable used in the function.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/os_dep/recv_linux.c

index 49d8845..3350bf3 100644 (file)
@@ -39,14 +39,12 @@ void rtw_os_recv_resource_alloc(struct recv_frame *precvframe)
 int rtw_os_recvbuf_resource_alloc(struct adapter *padapter,
                                  struct recv_buf *precvbuf)
 {
-       int res = _SUCCESS;
-
-       precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
-       if (precvbuf->purb == NULL)
-               res = _FAIL;
        precvbuf->pskb = NULL;
        precvbuf->reuse = false;
-       return res;
+       precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
+       if (!precvbuf->purb)
+               return _FAIL;
+       return _SUCCESS;
 }
 
 void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)