* [PATCH] staging: rtl8723bs: replace magic -2 error codes with proper errno
@ 2026-01-25 22:12 Omer El Idrissi
2026-01-27 14:43 ` Greg KH
2026-01-28 17:21 ` [PATCH v2] " Omer El Idrissi
0 siblings, 2 replies; 5+ messages in thread
From: Omer El Idrissi @ 2026-01-25 22:12 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Omer El Idrissi
In xmit_xmitframes function:
- Hardware busy condition previously
returned -2; changed to -EBUSY
- Transmit buffer allocation failure previously
returned -2; changed to ENOBUFS
The caller checks both errors and handles retry logic.This improves
readability and conforms to kernel error-handling
conventions.
Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
---
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index abb6fdfe7e1f..d1a427b2ef7f 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -205,7 +205,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
(padapter->mlmepriv.LinkDetectInfo.bHigherBusyTxTraffic)
) {
if ((phwxmit->accnt > 0) && (phwxmit->accnt < 5)) {
- err = -2;
+ err = -EBUSY; // supposed to return -EBUSY for these conditions???
break;
}
}
@@ -260,7 +260,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
"%s: xmit_buf is not enough!\n",
__func__);
#endif
- err = -2;
+ err = -ENOBUFS;
complete(&(pxmitpriv->xmit_comp));
break;
}
@@ -380,7 +380,7 @@ static s32 rtl8723bs_xmit_handler(struct adapter *padapter)
/* dequeue frame and write to hardware */
ret = xmit_xmitframes(padapter, pxmitpriv);
- if (ret == -2) {
+ if (ret == -EBUSY || ret == -ENOBUFS) {
/* here sleep 1ms will cause big TP loss of TX */
/* from 50+ to 40+ */
if (padapter->registrypriv.wifi_spec)
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: rtl8723bs: replace magic -2 error codes with proper errno
2026-01-25 22:12 [PATCH] staging: rtl8723bs: replace magic -2 error codes with proper errno Omer El Idrissi
@ 2026-01-27 14:43 ` Greg KH
2026-01-28 17:21 ` [PATCH v2] " Omer El Idrissi
1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2026-01-27 14:43 UTC (permalink / raw)
To: Omer El Idrissi; +Cc: linux-staging, linux-kernel
On Sun, Jan 25, 2026 at 11:12:18PM +0100, Omer El Idrissi wrote:
> In xmit_xmitframes function:
> - Hardware busy condition previously
> returned -2; changed to -EBUSY
> - Transmit buffer allocation failure previously
> returned -2; changed to ENOBUFS
>
> The caller checks both errors and handles retry logic.This improves
> readability and conforms to kernel error-handling
> conventions.
>
> Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
> ---
> drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> index abb6fdfe7e1f..d1a427b2ef7f 100644
> --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> @@ -205,7 +205,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
> (padapter->mlmepriv.LinkDetectInfo.bHigherBusyTxTraffic)
> ) {
> if ((phwxmit->accnt > 0) && (phwxmit->accnt < 5)) {
> - err = -2;
> + err = -EBUSY; // supposed to return -EBUSY for these conditions???
Why is this comment added? Who is going to answer that?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] staging: rtl8723bs: replace magic -2 error codes with proper errno
2026-01-25 22:12 [PATCH] staging: rtl8723bs: replace magic -2 error codes with proper errno Omer El Idrissi
2026-01-27 14:43 ` Greg KH
@ 2026-01-28 17:21 ` Omer El Idrissi
2026-01-29 7:27 ` Dan Carpenter
1 sibling, 1 reply; 5+ messages in thread
From: Omer El Idrissi @ 2026-01-28 17:21 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Omer El Idrissi
Changes since v1:
- Removed leftover comment accidentally left in previous version
- No functional changes
Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
---
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index abb6fdfe7e1f..8fa823f7bab3 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -205,7 +205,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
(padapter->mlmepriv.LinkDetectInfo.bHigherBusyTxTraffic)
) {
if ((phwxmit->accnt > 0) && (phwxmit->accnt < 5)) {
- err = -2;
+ err = -EBUSY;
break;
}
}
@@ -260,7 +260,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
"%s: xmit_buf is not enough!\n",
__func__);
#endif
- err = -2;
+ err = -ENOBUFS;
complete(&(pxmitpriv->xmit_comp));
break;
}
@@ -380,7 +380,7 @@ static s32 rtl8723bs_xmit_handler(struct adapter *padapter)
/* dequeue frame and write to hardware */
ret = xmit_xmitframes(padapter, pxmitpriv);
- if (ret == -2) {
+ if (ret == -EBUSY || ret == -ENOBUFS) {
/* here sleep 1ms will cause big TP loss of TX */
/* from 50+ to 40+ */
if (padapter->registrypriv.wifi_spec)
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] staging: rtl8723bs: replace magic -2 error codes with proper errno
2026-01-28 17:21 ` [PATCH v2] " Omer El Idrissi
@ 2026-01-29 7:27 ` Dan Carpenter
2026-01-29 17:26 ` Omer El Idrissi
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2026-01-29 7:27 UTC (permalink / raw)
To: Omer El Idrissi; +Cc: gregkh, linux-staging, linux-kernel
On Wed, Jan 28, 2026 at 06:21:43PM +0100, Omer El Idrissi wrote:
> Changes since v1:
> - Removed leftover comment accidentally left in previous version
> - No functional changes
>
> Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
No commit message.
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
Why is do you change -2 to both -EBUSY and -ENOBUFS? In the original
code, the -1 and -2 return meant something custom and they weren't
kernel error codes:
* Return:
*0 Success
*-1 Hardware resource(TX FIFO) not ready
*-2 Software resource(xmitbuf) not ready
Now the documentation makes no sense.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] staging: rtl8723bs: replace magic -2 error codes with proper errno
2026-01-29 7:27 ` Dan Carpenter
@ 2026-01-29 17:26 ` Omer El Idrissi
0 siblings, 0 replies; 5+ messages in thread
From: Omer El Idrissi @ 2026-01-29 17:26 UTC (permalink / raw)
To: Dan Carpenter; +Cc: gregkh, linux-staging, linux-kernel
Thanks for the explanation. I'll drop this change and revisit it once
i'm more familiar with the driver
On 1/29/26 8:27 AM, Dan Carpenter wrote:
> On Wed, Jan 28, 2026 at 06:21:43PM +0100, Omer El Idrissi wrote:
>> Changes since v1:
>> - Removed leftover comment accidentally left in previous version
>> - No functional changes
>>
>> Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
> No commit message.
>
> https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
>
> Why is do you change -2 to both -EBUSY and -ENOBUFS? In the original
> code, the -1 and -2 return meant something custom and they weren't
> kernel error codes:
>
> * Return:
> *0 Success
> *-1 Hardware resource(TX FIFO) not ready
> *-2 Software resource(xmitbuf) not ready
>
> Now the documentation makes no sense.
>
> regards,
> dan carpenter
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-29 17:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-25 22:12 [PATCH] staging: rtl8723bs: replace magic -2 error codes with proper errno Omer El Idrissi
2026-01-27 14:43 ` Greg KH
2026-01-28 17:21 ` [PATCH v2] " Omer El Idrissi
2026-01-29 7:27 ` Dan Carpenter
2026-01-29 17:26 ` Omer El Idrissi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox