From: Hungyu Lin <dennylin0707@gmail.com>
To: gregkh@linuxfoundation.org
Cc: error27@gmail.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, Hungyu Lin <dennylin0707@gmail.com>
Subject: [PATCH v2 2/4] staging: rtl8723bs: simplify update_attrib control flow
Date: Mon, 15 Jun 2026 23:43:38 +0000 [thread overview]
Message-ID: <20260615234340.97299-3-dennylin0707@gmail.com> (raw)
In-Reply-To: <20260615234340.97299-1-dennylin0707@gmail.com>
Replace goto-based error handling with direct returns and
remove the temporary res variable.
No functional change.
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
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 6ab91de472b0..69b6d3a2554a 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)
--
2.34.1
next prev parent reply other threads:[~2026-06-15 23:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 23:43 [PATCH v2 0/4] staging: rtl8723bs: convert update_attrib path to errno Hungyu Lin
2026-06-15 23:43 ` [PATCH v2 1/4] staging: rtl8723bs: simplify update_attrib_sec_info control flow Hungyu Lin
2026-06-15 23:43 ` Hungyu Lin [this message]
2026-06-15 23:43 ` [PATCH v2 3/4] staging: rtl8723bs: convert update_attrib_sec_info to return errno Hungyu Lin
2026-06-16 7:39 ` Dan Carpenter
2026-06-15 23:43 ` [PATCH v2 4/4] staging: rtl8723bs: convert update_attrib " Hungyu Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260615234340.97299-3-dennylin0707@gmail.com \
--to=dennylin0707@gmail.com \
--cc=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox