From: Dan Carpenter <dan.carpenter@linaro.org>
To: Xichao Zhao <zhao.xichao@vivo.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: drop redundant conversion to bool
Date: Wed, 27 Aug 2025 11:02:40 +0300 [thread overview]
Message-ID: <aK67oBH4cQ10C4A6@stanley.mountain> (raw)
In-Reply-To: <20250827031500.91732-1-zhao.xichao@vivo.com>
On Wed, Aug 27, 2025 at 11:15:00AM +0800, Xichao Zhao wrote:
> The result of integer comparison already evaluates to bool. No need for
> explicit conversion.
>
> No functional impact.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 +++---
> drivers/staging/rtl8723bs/os_dep/osdep_service.c | 4 ++--
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index 692d0c2b766d..570c99192d3f 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -1597,7 +1597,7 @@ inline bool rtw_is_scan_deny(struct adapter *adapter)
> {
> struct mlme_priv *mlmepriv = &adapter->mlmepriv;
>
> - return (atomic_read(&mlmepriv->set_scan_deny) != 0) ? true : false;
> + return (atomic_read(&mlmepriv->set_scan_deny) != 0);
mlmepriv->set_scan_deny is either 0 or 1 so it's cleaner to just do:
return atomic_read(&mlmepriv->set_scan_deny);
(avoids the double negative).
regards,
dan carpenter
prev parent reply other threads:[~2025-08-27 8:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 3:15 [PATCH] staging: rtl8723bs: drop redundant conversion to bool Xichao Zhao
2025-08-27 8:02 ` 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=aK67oBH4cQ10C4A6@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=zhao.xichao@vivo.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.