staging: r8188eu: os_dep: remove the goto statement
authorSaurav Girepunje <saurav.girepunje@gmail.com>
Wed, 3 Nov 2021 15:48:41 +0000 (21:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Nov 2021 09:02:02 +0000 (10:02 +0100)
Remove the goto statement from rtw_init_drv_sw(). In this function goto
can be replace by return statement. As on goto label exit, function
only return it is not performing any cleanup. Avoiding goto will
improve the function readability.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YYKvWeyqd71pYSqM@Sauravs-MacBook-Air.local
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/os_dep/os_intfs.c

index 1005924..9fb65be 100644 (file)
@@ -480,48 +480,37 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
 {
        u8      ret8 = _SUCCESS;
 
-       if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
-               ret8 = _FAIL;
-               goto exit;
-       }
+       if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL)
+               return _FAIL;
 
        padapter->cmdpriv.padapter = padapter;
 
-       if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) {
-               ret8 = _FAIL;
-               goto exit;
-       }
+       if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL)
+               return _FAIL;
 
-       if (rtw_init_mlme_priv(padapter) == _FAIL) {
-               ret8 = _FAIL;
-               goto exit;
-       }
+       if (rtw_init_mlme_priv(padapter) == _FAIL)
+               return _FAIL;
 
        rtw_init_wifidirect_timers(padapter);
        init_wifidirect_info(padapter, P2P_ROLE_DISABLE);
        reset_global_wifidirect_info(padapter);
 
-       if (init_mlme_ext_priv(padapter) == _FAIL) {
-               ret8 = _FAIL;
-               goto exit;
-       }
+       if (init_mlme_ext_priv(padapter) == _FAIL)
+               return _FAIL;
 
        if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) {
                DBG_88E("Can't _rtw_init_xmit_priv\n");
-               ret8 = _FAIL;
-               goto exit;
+               return _FAIL;
        }
 
        if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL) {
                DBG_88E("Can't _rtw_init_recv_priv\n");
-               ret8 = _FAIL;
-               goto exit;
+               return _FAIL;
        }
 
        if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) {
                DBG_88E("Can't _rtw_init_sta_priv\n");
-               ret8 = _FAIL;
-               goto exit;
+               return _FAIL;
        }
 
        padapter->stapriv.padapter = padapter;
@@ -537,7 +526,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
 
        spin_lock_init(&padapter->br_ext_lock);
 
-exit:
        return ret8;
 }