Re: [PATCH v4] staging: rtl8723bs: return bool from check_pending_xmitbuf
From: Dan Carpenter
Date: Thu Oct 01 2026 - 10:56:52 EST
On Thu, Oct 01, 2026 at 11:06:40AM -0300, Matheus Alves de Almeida wrote:
> check_pending_xmitbuf() returns only true or false. Use bool as its
> return type to accurately describe the function's behavior and
> propagate the return type through one of the call chains.
>
> Signed-off-by: Matheus Alves de Almeida <matheus.aalmeida@xxxxxxxxxxxx>
> ---
> v2: Add missing "staging: " prefix to commit message.
> v3: Change one of the call chains to also return bool.
> v4:
> - rtw_transmit_thread(): rename err -> xmit_status and remove
> unnescessary initialization.
> - check_pending_xmitbuf(): rename ret -> xmitbuf_pending and remove
> unnescessary if statement.
> - rtl8723bs_xmit_buf_handler(): remove queue_pending and directly
> check the value returned by check_pending_xmitbuf() instead.
>
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 16 +++++++---------
> drivers/staging/rtl8723bs/hal/hal_intf.c | 2 +-
> drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 8 +++-----
> drivers/staging/rtl8723bs/include/hal_intf.h | 2 +-
> .../staging/rtl8723bs/include/rtl8723b_xmit.h | 2 +-
> drivers/staging/rtl8723bs/include/rtw_xmit.h | 2 +-
> 6 files changed, 14 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 57b3690bc48af..513a4934ab599 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -2463,37 +2463,35 @@ struct xmit_buf *dequeue_pending_xmitbuf_under_survey(struct xmit_priv *pxmitpri
> return pxmitbuf;
> }
>
> -signed int check_pending_xmitbuf(struct xmit_priv *pxmitpriv)
> +bool check_pending_xmitbuf(struct xmit_priv *pxmitpriv)
Ideally boolean functions would have a name that indicates what
the return means. For example, if (has_pending()) is clear.
if (check_pending()) is less clear.
regards,
dan carpenter