From 03a48985c04ae89747eaf0cdb263c6114faf7c25 Mon Sep 17 00:00:00 2001 From: Hungyu Lin Date: Tue, 7 Jul 2026 11:25:01 +0000 Subject: [PATCH] staging: rtl8723bs: simplify update_attrib control flow Replace goto-based error handling with direct returns and remove the temporary res variable. No functional change. Signed-off-by: Hungyu Lin Link: https://patch.msgid.link/20260707112503.612-3-dennylin0707@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_xmit.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 9f54a7252159..a91d4e12b724 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,19 +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 we cannot get psta => drop the pkt */ - res = _FAIL; - goto exit; + return _FAIL; } if (!(psta->state & _FW_LINKED)) @@ -762,8 +757,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 +793,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)