[PATCH 2/4] staging: rtl8723bs: simplify update_attrib control flow
From: Hungyu Lin
Date: Sun Jun 14 2026 - 14:23:54 EST
Replace goto-based error handling with direct returns and
remove the temporary res variable.
No functional change.
Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_xmit.c | 25 ++++++++---------------
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 6ab91de472b0..7d10caf8cbfe 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -664,7 +664,6 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
struct sta_priv *pstapriv = &padapter->stapriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
- signed int res = _SUCCESS;
int ret;
_rtw_open_pktfile(pkt, &pktfile);
@@ -741,20 +740,15 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
psta = rtw_get_bcmc_stainfo(padapter);
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
- if (!psta) { /* if we cannot get psta => drop the pkt */
- res = _FAIL;
- goto exit;
- } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && !(psta->state & _FW_LINKED)) {
- res = _FAIL;
- goto exit;
- }
+ if (!psta) /* if we cannot get psta => drop the pkt */
+ return _FAIL;
+ else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && !(psta->state & _FW_LINKED))
+ return _FAIL;
}
- if (!psta) {
+ if (!psta)
/* if we cannot get psta => drop the pkt */
- res = _FAIL;
- goto exit;
- }
+ return _FAIL;
if (!(psta->state & _FW_LINKED))
return _FAIL;
@@ -762,8 +756,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
spin_lock_bh(&psta->lock);
if (update_attrib_sec_info(padapter, pattrib, psta) == _FAIL) {
spin_unlock_bh(&psta->lock);
- res = _FAIL;
- goto exit;
+ return _FAIL;
}
update_attrib_phy_info(padapter, pattrib, psta);
@@ -799,9 +792,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
}
/* pattrib->priority = 5; force to used VI queue, for testing */
-
-exit:
- return res;
+ return _SUCCESS;
}
static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitframe)
--
2.34.1