]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: rtl8723bs: convert rtw_xmit_classifier to return errno
authorHungyu Lin <dennylin0707@gmail.com>
Thu, 14 May 2026 10:07:06 +0000 (10:07 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 May 2026 10:39:51 +0000 (12:39 +0200)
Convert rtw_xmit_classifier() to return 0 on success and
negative error codes on failure.

Update the caller to check for non-zero return values and
preserve the existing _FAIL/_SUCCESS semantics.

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

index b9dc54cdf40141aa0ea5c9e4c97f635a73d752f9..46ee8f43064adcdde675b682fc6442ed28161346 100644 (file)
@@ -1818,7 +1818,7 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram
  * Will enqueue pxmitframe to the proper queue,
  * and indicate it to xx_pending list.....
  */
-static s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)
+static int rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)
 {
        u8 ac_index;
        struct sta_info *psta;
@@ -1828,13 +1828,13 @@ static s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmi
 
        psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
        if (pattrib->psta != psta)
-               return _FAIL;
+               return -ENODEV;
 
        if (!psta)
-               return _FAIL;
+               return -EINVAL;
 
        if (!(psta->state & _FW_LINKED))
-               return _FAIL;
+               return -ENETDOWN;
 
        ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index));
 
@@ -1845,12 +1845,15 @@ static s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmi
        ptxservq->qcnt++;
        phwxmits[ac_index].accnt++;
 
-       return _SUCCESS;
+       return 0;
 }
 
 s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe)
 {
-       if (rtw_xmit_classifier(padapter, pxmitframe) == _FAIL)
+       int res;
+
+       res = rtw_xmit_classifier(padapter, pxmitframe);
+       if (res)
                return _FAIL;
 
        return _SUCCESS;