]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: rtl8723bs: simplify rtw_enqueue_cmd control flow
authorHungyu Lin <dennylin0707@gmail.com>
Wed, 13 May 2026 21:37:18 +0000 (21:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 May 2026 10:39:28 +0000 (12:39 +0200)
Replace the goto exit pattern with direct returns to simplify
the control flow and improve readability.

No functional change intended.

Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Link: https://patch.msgid.link/20260513213719.12246-4-dennylin0707@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_cmd.c

index a9b06c10c9aadae45cd1b74de0bb1d7e8c12f972..169e20bbd90bca28146cd34a146aef86fe2a4512 100644 (file)
@@ -313,18 +313,18 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 
 int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 {
-       int res = _FAIL;
+       int res;
        struct adapter *padapter = pcmdpriv->padapter;
 
        if (!cmd_obj)
-               goto exit;
+               return _FAIL;
 
        cmd_obj->padapter = padapter;
 
        res = rtw_cmd_filter(pcmdpriv, cmd_obj);
        if (res == _FAIL) {
                rtw_free_cmd_obj(cmd_obj);
-               goto exit;
+               return _FAIL;
        }
 
        res = _rtw_enqueue_cmd(&pcmdpriv->cmd_queue, cmd_obj);
@@ -332,7 +332,6 @@ int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
        if (res == _SUCCESS)
                complete(&pcmdpriv->cmd_queue_comp);
 
-exit:
        return res;
 }