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 v3 4/4] staging: rtl8723bs: convert update_attrib to return errno
Date: Wed, 17 Jun 2026 12:16:54 +0000 [thread overview]
Message-ID: <20260617121654.27-1-dennylin0707@gmail.com> (raw)
Convert update_attrib() to return 0 on success and a
negative errno on failure. Update rtw_xmit() to handle
the returned error code.
No functional change intended.
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_xmit.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 066f6e974e4e..4d886a35f4c8 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -654,7 +654,7 @@ static int set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
return 0;
}
-static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct pkt_attrib *pattrib)
+static int update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct pkt_attrib *pattrib)
{
struct pkt_file pktfile;
struct sta_info *psta = NULL;
@@ -741,24 +741,24 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
if (!psta) /* if we cannot get psta => drop the pkt */
- return _FAIL;
+ return -EINVAL;
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && !(psta->state & _FW_LINKED))
- return _FAIL;
+ return -EINVAL;
}
if (!psta) {
/* if we cannot get psta => drop the pkt */
- return _FAIL;
+ return -EINVAL;
}
if (!(psta->state & _FW_LINKED))
- return _FAIL;
+ return -EINVAL;
spin_lock_bh(&psta->lock);
ret = update_attrib_sec_info(padapter, pattrib, psta);
if (ret) {
spin_unlock_bh(&psta->lock);
- return _FAIL;
+ return ret;
}
update_attrib_phy_info(padapter, pattrib, psta);
@@ -794,7 +794,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
}
/* pattrib->priority = 5; force to used VI queue, for testing */
- return _SUCCESS;
+ return 0;
}
static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitframe)
@@ -1955,7 +1955,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct xmit_frame *pxmitframe = NULL;
- s32 res;
+ int ret;
if (start == 0)
start = jiffies;
@@ -1968,9 +1968,8 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
if (!pxmitframe)
return -1;
- res = update_attrib(padapter, *ppkt, &pxmitframe->attrib);
-
- if (res != _SUCCESS) {
+ ret = update_attrib(padapter, *ppkt, &pxmitframe->attrib);
+ if (ret) {
rtw_free_xmitframe(pxmitpriv, pxmitframe);
return -1;
}
--
2.34.1
reply other threads:[~2026-06-17 12:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260617121654.27-1-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