All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hungyu Lin <dennylin0707@gmail.com>
To: gregkh@linuxfoundation.org
Cc: error27@gmail.com, khomenkov@mailbox.org,
	khushalchitturi@gmail.com, s9430939@naver.com,
	nikolayof23@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, Hungyu Lin <dennylin0707@gmail.com>
Subject: [PATCH 3/5] staging: rtl8723bs: convert xmitframe_addmic() to return errno
Date: Mon, 13 Jul 2026 07:05:35 +0000	[thread overview]
Message-ID: <20260713070537.15903-4-dennylin0707@gmail.com> (raw)
In-Reply-To: <20260713070537.15903-1-dennylin0707@gmail.com>

Convert xmitframe_addmic() to return 0 on success and
a negative errno on failure.

Update the immediate caller to handle errno return values
while preserving the existing _SUCCESS/_FAIL semantics.

No functional change intended.

Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 98b886732646..07e413f4dbdb 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -797,7 +797,7 @@ static int update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
 	return 0;
 }
 
-static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitframe)
+static int xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitframe)
 {
 	signed int			curfragnum, length;
 	u8 *pframe, *payload, mic[8];
@@ -820,12 +820,12 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
 
 			if (bmcst) {
 				if (!memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16))
-					return _FAIL;
+					return -EINVAL;
 				/* start to calculate the mic code */
 				rtw_secmicsetkey(&micdata, psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey);
 			} else {
 				if (!memcmp(&pattrib->dot11tkiptxmickey.skey[0], null_key, 16))
-					return _FAIL;
+					return -EINVAL;
 				/* start to calculate the mic code */
 				rtw_secmicsetkey(&micdata, &pattrib->dot11tkiptxmickey.skey[0]);
 			}
@@ -876,7 +876,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
 			pattrib->last_txcmdsz += 8;
 			}
 	}
-	return _SUCCESS;
+	return 0;
 }
 
 static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmitframe)
@@ -1175,7 +1175,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
 		memcpy(mem_start, pbuf_start + hw_hdr_offset, pattrib->hdrlen);
 	}
 
-	if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) {
+	ret = xmitframe_addmic(padapter, pxmitframe);
+	if (ret) {
 		res = _FAIL;
 		goto exit;
 	}
-- 
2.43.0


  parent reply	other threads:[~2026-07-13  7:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  7:05 [PATCH 0/5] staging: rtl8723bs: convert xmit helpers to return errno Hungyu Lin
2026-07-13  7:05 ` [PATCH 1/5] staging: rtl8723bs: remove redundant return variable in rtw_make_wlanhdr() Hungyu Lin
2026-07-13  7:05 ` [PATCH 2/5] staging: rtl8723bs: convert rtw_make_wlanhdr() to return errno Hungyu Lin
2026-07-13  8:16   ` Dan Carpenter
2026-07-13  7:05 ` Hungyu Lin [this message]
2026-07-13  7:05 ` [PATCH 4/5] staging: rtl8723bs: simplify rtw_xmitframe_coalesce() control flow Hungyu Lin
2026-07-13  7:05 ` [PATCH 5/5] staging: rtl8723bs: convert rtw_xmitframe_coalesce() to return errno Hungyu Lin
2026-07-13  8:15 ` [PATCH 0/5] staging: rtl8723bs: convert xmit helpers " Dan Carpenter

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=20260713070537.15903-4-dennylin0707@gmail.com \
    --to=dennylin0707@gmail.com \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khomenkov@mailbox.org \
    --cc=khushalchitturi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nikolayof23@gmail.com \
    --cc=s9430939@naver.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.