staging: rtl8188eu: clean up rtw_recv_entry
authorMartin Kaiser <martin@kaiser.cx>
Wed, 7 Apr 2021 17:05:27 +0000 (19:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Apr 2021 07:26:32 +0000 (09:26 +0200)
Change the return type to int, the function returns 0 or 1.
Remove the goto statement, we're not doing any cleanup on exit.
Summarize variable declarations and assignments.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210407170531.29356-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_recv.c

index b9b4bc4..b2fe448 100644 (file)
@@ -1962,27 +1962,18 @@ exit:
        return ret;
 }
 
-s32 rtw_recv_entry(struct recv_frame *precvframe)
+int rtw_recv_entry(struct recv_frame *precvframe)
 {
-       struct adapter *padapter;
-       struct recv_priv *precvpriv;
-       s32 ret = _SUCCESS;
-
-       padapter = precvframe->adapter;
-
-       precvpriv = &padapter->recvpriv;
+       struct adapter *padapter = precvframe->adapter;
+       struct recv_priv *precvpriv = &padapter->recvpriv;
+       int ret;
 
        ret = recv_func(padapter, precvframe);
-       if (ret == _FAIL) {
+       if (ret == _SUCCESS)
+               precvpriv->rx_pkts++;
+       else
                RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("%s: recv_func return fail!!!\n", __func__));
-               goto _recv_entry_drop;
-       }
-
-       precvpriv->rx_pkts++;
-
-       return ret;
 
-_recv_entry_drop:
        return ret;
 }