mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Matheus Alves de Almeida <matheus.aalmeida@inf.ufrgs.br>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] staging: rtl8723bs: return bool from check_pending_xmitbuf
Date: Thu, 1 Oct 2026 17:41:25 +0300	[thread overview]
Message-ID: <ar5xFfULgNEwWeQM@stanley.mountain> (raw)
In-Reply-To: <20261001140640.107536-1-matheus.aalmeida@inf.ufrgs.br>

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@inf.ufrgs.br>
> ---
> 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


      reply	other threads:[~2026-10-01 14:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 14:06 Matheus Alves de Almeida
2026-10-01 14:41 ` Dan Carpenter [this message]

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=ar5xFfULgNEwWeQM@stanley.mountain \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=matheus.aalmeida@inf.ufrgs.br \
    /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

all inboxes | Powered by JetHome®