From: Greg KH <gregkh@linuxfoundation.org>
To: Kushal Kothari <kushalkothari285@gmail.com>
Cc: fabioaiuto83@gmail.com, marcocesati@gmail.com,
dan.carpenter@oracle.com, ross.schm.dev@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
outreachy-kernel@googlegroups.com, mike.rapoport@gmail.com,
staging@lists.linux.dev
Subject: Re: [PATCH v2] staging: rtl8723bs: core: Remove true and false comparison
Date: Wed, 20 Oct 2021 13:03:34 +0200 [thread overview]
Message-ID: <YW/3hsflTpx3dSLK@kroah.com> (raw)
In-Reply-To: <20211020105401.131254-1-kushalkothari285@gmail.com>
On Wed, Oct 20, 2021 at 04:24:01PM +0530, Kushal Kothari wrote:
> Remove comparison to true and false in if statement.
> Issue found with checkpatch.pl.
> CHECK: Using comparison to true is error prone
> CHECK: Using comparison to false is error prone
>
> Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
> ---
>
> Changes in v2: Remove unnecessary parentheses.
>
> drivers/staging/rtl8723bs/core/rtw_cmd.c | 50 ++++++++++++------------
> 1 file changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> index efc9b1974e38..3e0b910114da 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> @@ -309,8 +309,8 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
> if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
> bAllow = true;
>
> - if ((pcmdpriv->padapter->hw_init_completed == false && bAllow == false)
> - || atomic_read(&(pcmdpriv->cmdthd_running)) == false /* com_thread not running */
> + if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
> + !atomic_read(&pcmdpriv->cmdthd_running) /* com_thread not running */
> )
> return _FAIL;
>
> @@ -372,7 +372,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
> void rtw_stop_cmd_thread(struct adapter *adapter)
> {
> if (adapter->cmdThread &&
> - atomic_read(&(adapter->cmdpriv.cmdthd_running)) == true &&
> + atomic_read(&adapter->cmdpriv.cmdthd_running) &&
> adapter->cmdpriv.stop_req == 0) {
> adapter->cmdpriv.stop_req = 1;
> complete(&adapter->cmdpriv.cmd_queue_comp);
> @@ -388,7 +388,7 @@ int rtw_cmd_thread(void *context)
> u8 (*cmd_hdl)(struct adapter *padapter, u8 *pbuf);
> void (*pcmd_callback)(struct adapter *dev, struct cmd_obj *pcmd);
> struct adapter *padapter = context;
> - struct cmd_priv *pcmdpriv = &(padapter->cmdpriv);
> + struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
This is not described in your changelog text and has nothing to do with
booleans :(
prev parent reply other threads:[~2021-10-20 11:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 10:54 [PATCH v2] staging: rtl8723bs: core: Remove true and false comparison Kushal Kothari
2021-10-20 11:00 ` [Outreachy kernel] " Julia Lawall
2021-10-20 11:03 ` Greg KH [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=YW/3hsflTpx3dSLK@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=dan.carpenter@oracle.com \
--cc=fabioaiuto83@gmail.com \
--cc=kushalkothari285@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=marcocesati@gmail.com \
--cc=mike.rapoport@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=ross.schm.dev@gmail.com \
--cc=staging@lists.linux.dev \
/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